Using MDBs for durable subscriptions
I need to be able to deploy my MDB as a durable subscriber i.e I have my MDB ubscribing to a Topic. For some reason if the application hosting the MDB(message driven bean) fails, I would like the JMS provider to republish all the messages that were already in the Topic in addition to those messages which might have been published when the MDB application was down.
I am trying to achieve this using Weblogic 7.0. The weblogic documentation says that messages will not be accumulated if the MDB using durable subscriptions is not deployed(which would be the case when the MDB application failed).
Any ideas on how I could design around this shortcoming within WLS?
Thanks
Ramdas
The WLS documentation for MDBs says :
"If your bean will demarcate its own transaction
boundaries, set the acknowledge-mode sub-element to
specify the JMS acknowledgment semantics to use. This
element has two possible values: AUTO_ACKNOWLEDGE (the
default) or DUPS_OK_ACKNOWLEDGE."Okay, I missed the part where you were specifying WLS. In the case quoted above, you will have to explicitly rollback the transaction and make sure that your MDB is set to transaction "Required" (or "RequiresNew").
I am not sure what you meant by "concurrency issues"
when using MDBs.
Please could you clarify.Sure, if your BMP, as called from the MDB, blows up, you rollback the transaction. Which means the EXACT SAME message that caused the error will get redelivered, based upon your server settings: either immediately or within the delay period.
This means that while your first MDB is (potentially) still dealing with whatever problems the message caused in the BMP, a second invocation of the MDB can be starting, albeit in another transaction. The state of your BMP could be undefined in this situation - which could cause an entirely different set of problems.
Even though you program EJBs as "single-threaded," you still have to consider the likelyhood of multiple invocations accessing/changing the same "piece" of data. Yes, that's what transactions are for - but there can be programmatic holes where this kind of situation can arise. You just have to be careful about what you're doing.
Similar Messages
-
Using MDBs for long running transactions
Although MDBs are not the best vehicles for running long transactions, I am
forced to use them for one such scenario (let's say for lack of a better
pattern). In order to let my long running MDB (with Container Managed Tx)
do it's chores I increased the time-out value to a higher number rather than
using the default of 30 secs. Strangely, I was seeing
IllegalStateExceptions in stdout. So I created a brand new test MDB with a
Thread.sleep for 60 seconds, increased my MDBs timeout value to 120 secs,
made sure there was only one MDB in the pool and ran the test again. I
still see the below error after 30 seconds.
I guess I should probably open a support case, but I thought I'll post here
as well in case there's something I am missing.
<May 27, 2003 5:26:31 PM PDT> <Notice> <EJB> <Error marking transaction for
rollback: java.lang.IllegalStateException: Cannot m
ark the transaction for rollback. xid=64:bea55f200db2c786, status=Rolled
back. [Reason=weblogic.transaction.internal.TimedOutEx
ception: Transaction timed out after 34 seconds
Xid=64:bea55f200db2c786(-33600248),Status=Active,numRepliesOwedMe=0,numRepli
esOwedOthers=0,seconds since begin=34,seconds left=
30,activeThread=Thread[ExecuteThread: '9' for queue: 'default',5,Thread
Group for Queue: 'default'],ServerResourceInfo[JMS_hmJD
BCStore]=(state=started,assigned=none),SCInfo[wlcsDomain+wlcsServer]=(state=
active),OwnerTransactionManager=ServerTM[ServerCoor
dinatorDescriptor=(CoordinatorURL=wlcsServer+155.14.3.140:7501+wlcsDomain+,
Resources={})],CoordinatorURL=wlcsServer+155.14.3.1
40:7501+wlcsDomain+)]
java.lang.IllegalStateException: Cannot mark the transaction for rollback.
xid=64:bea55f200db2c786, status=Rolled back. [Reason
=weblogic.transaction.internal.TimedOutException: Transaction timed out
after 34 seconds
Xid=64:bea55f200db2c786(-33600248),Status=Active,numRepliesOwedMe=0,numRepli
esOwedOthers=0,seconds since begin=34,seconds left=
30,activeThread=Thread[ExecuteThread: '9' for queue: 'default',5,Thread
Group for Queue: 'default'],ServerResourceInfo[JMS_hmJD
BCStore]=(state=started,assigned=none),SCInfo[wlcsDomain+wlcsServer]=(state=
active),OwnerTransactionManager=ServerTM[ServerCoor
dinatorDescriptor=(CoordinatorURL=wlcsServer+155.14.3.140:7501+wlcsDomain+,
Resources={})],CoordinatorURL=wlcsServer+155.14.3.1
40:7501+wlcsDomain+)]
at
weblogic.transaction.internal.TransactionImpl.throwIllegalStateException(Tra
nsactionImpl.java:1486)
at
weblogic.transaction.internal.TransactionImpl.setRollbackOnly(TransactionImp
l.java:466)
at
weblogic.ejb20.manager.BaseEJBManager.handleSystemException(BaseEJBManager.j
ava:255)
at
weblogic.ejb20.manager.BaseEJBManager.setupTxListener(BaseEJBManager.java:21
5)
at
weblogic.ejb20.manager.StatelessManager.preInvoke(StatelessManager.java:153)
at
weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:117)
at
weblogic.ejb20.internal.StatelessEJBObject.preInvoke(StatelessEJBObject.java
:63)
at
com.xoriant.hm.ejb.session.HierarchyManagerBean_fzysig_EOImpl.getHierarchyId
(HierarchyManagerBean_fzysig_EOImpl.java
:1477)
at
com.ebiz.application.customerprofile.hm.CPXHMController.SynchronizeMHTH(Unkn
own Source)
at
com.ebiz.application.customerprofile.hm.CPHMOrgGroupMsgBean.onMessage(Unknow
n Source)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:254)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Hi Adarsh,
It may be that the transaction time-out setting in the descriptor
is not taking effect. The tx is still timing out after
the default 30 seconds, so the later attempt to call
"setRollbackOnly" fails as the transaction has already
rolled back The ignored descriptor setting is a known issue
in some earlier SPs, but I'm not sure when and where it
was fixed - so yes, contact customer support. The work-around
is to set the default transaction time-out for the entire server to a
higher value. (I'm not sure where to set this on the console,
but the relevant JTA MBean field is "TimeoutSeconds".)
Tom
Adarsh Dattani wrote:
> Although MDBs are not the best vehicles for running long transactions, I am
> forced to use them for one such scenario (let's say for lack of a better
> pattern). In order to let my long running MDB (with Container Managed Tx)
> do it's chores I increased the time-out value to a higher number rather than
> using the default of 30 secs. Strangely, I was seeing
> IllegalStateExceptions in stdout. So I created a brand new test MDB with a
> Thread.sleep for 60 seconds, increased my MDBs timeout value to 120 secs,
> made sure there was only one MDB in the pool and ran the test again. I
> still see the below error after 30 seconds.
> I guess I should probably open a support case, but I thought I'll post here
> as well in case there's something I am missing.
>
> <May 27, 2003 5:26:31 PM PDT> <Notice> <EJB> <Error marking transaction for
> rollback: java.lang.IllegalStateException: Cannot m
>
> ark the transaction for rollback. xid=64:bea55f200db2c786, status=Rolled
> back. [Reason=weblogic.transaction.internal.TimedOutEx
>
> ception: Transaction timed out after 34 seconds
>
> Xid=64:bea55f200db2c786(-33600248),Status=Active,numRepliesOwedMe=0,numRepli
> esOwedOthers=0,seconds since begin=34,seconds left=
>
> 30,activeThread=Thread[ExecuteThread: '9' for queue: 'default',5,Thread
> Group for Queue: 'default'],ServerResourceInfo[JMS_hmJD
>
> BCStore]=(state=started,assigned=none),SCInfo[wlcsDomain+wlcsServer]=(state=
> active),OwnerTransactionManager=ServerTM[ServerCoor
>
> dinatorDescriptor=(CoordinatorURL=wlcsServer+155.14.3.140:7501+wlcsDomain+,
> Resources={})],CoordinatorURL=wlcsServer+155.14.3.1
>
> 40:7501+wlcsDomain+)]
>
> java.lang.IllegalStateException: Cannot mark the transaction for rollback.
> xid=64:bea55f200db2c786, status=Rolled back. [Reason
>
> =weblogic.transaction.internal.TimedOutException: Transaction timed out
> after 34 seconds
>
> Xid=64:bea55f200db2c786(-33600248),Status=Active,numRepliesOwedMe=0,numRepli
> esOwedOthers=0,seconds since begin=34,seconds left=
>
> 30,activeThread=Thread[ExecuteThread: '9' for queue: 'default',5,Thread
> Group for Queue: 'default'],ServerResourceInfo[JMS_hmJD
>
> BCStore]=(state=started,assigned=none),SCInfo[wlcsDomain+wlcsServer]=(state=
> active),OwnerTransactionManager=ServerTM[ServerCoor
>
> dinatorDescriptor=(CoordinatorURL=wlcsServer+155.14.3.140:7501+wlcsDomain+,
> Resources={})],CoordinatorURL=wlcsServer+155.14.3.1
>
> 40:7501+wlcsDomain+)]
>
> at
> weblogic.transaction.internal.TransactionImpl.throwIllegalStateException(Tra
> nsactionImpl.java:1486)
>
> at
> weblogic.transaction.internal.TransactionImpl.setRollbackOnly(TransactionImp
> l.java:466)
>
> at
> weblogic.ejb20.manager.BaseEJBManager.handleSystemException(BaseEJBManager.j
> ava:255)
>
> at
> weblogic.ejb20.manager.BaseEJBManager.setupTxListener(BaseEJBManager.java:21
> 5)
>
> at
> weblogic.ejb20.manager.StatelessManager.preInvoke(StatelessManager.java:153)
>
> at
> weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:117)
>
> at
> weblogic.ejb20.internal.StatelessEJBObject.preInvoke(StatelessEJBObject.java
> :63)
>
> at
> com.xoriant.hm.ejb.session.HierarchyManagerBean_fzysig_EOImpl.getHierarchyId
> (HierarchyManagerBean_fzysig_EOImpl.java
>
> :1477)
>
> at
> com.ebiz.application.customerprofile.hm.CPXHMController.SynchronizeMHTH(Unkn
> own Source)
>
> at
> com.ebiz.application.customerprofile.hm.CPHMOrgGroupMsgBean.onMessage(Unknow
> n Source)
>
> at weblogic.ejb20.internal.MDListener.execute(MDListener.java:254)
>
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
>
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
>
>
>
-
My JMS 2 wish list - Part 4, durable subscriptions
I attended the JavaOne 2010 session on future JMS evolutions. During the session I described some current limitations or issues I'd like to be solved in a portable way. I've been adviced to share the issues to get feedback from the community. I will post each issue in a dedicated thread.
Issue 4 - How durable are durable topic subscriptions?
Non durable subscribers receive topic messages only if they are active at the time when the message is received and processed by the JMS engine. Durable subscribers are more complicated, they receive messages if the durable subscription is active when the message is received and processed by the JMS engine.
How do I know when messages are kept or discarded? Simply put, what is the lifecycle of the subscription?
When using synchronous receptions or message listeners, the durable subscription lifecycle is managed by the developper using Session:createDurableSubscriber and Session:unsubscribe.
When using MDB, the durable subscription lifecycle is unspecified and is application server dependant.
With JBoss 4.2, the subscription lifecyle is the same than the MDB. This means that if the application is redeployed (for example copy the new .ear over the old one in the deploy folder), there is a time frame when the subscription in non existent, so messages are lost.
WebLogic 10 also seems to associate the subscription lifecycle to the MDB. WebLogic 10 offers a flag, "durable-subscription-deletion", to allow or not the durable subscription deletion when the MDB is undeployed or removed. True means that when the application is redeployed the subscription is deleted and messages are lost. When false is used (it is the default value) the subscription remains even when the MDB is undeployed. I hope this does not mean that if we permanently undeploy the application, the subscription will stay and messages will continue to stack.
With WebSphere 6 the situation is different. The subscription is not associated to the MDB but to an activation spec that is an administred object. The MDB is merely a client of the activation spec. This way messages are kept as long as the activation spec is active, regardless of application starts/stops/redeploys/etc. Messages are not lost.
We need a portable way to use durable topics subscriptions.gimbal2 wrote:
A portable solution would be useful.You could already do it now by leveraging the Timer functionality that has been part of the EJB spec since JEE 1.4. In stead of sending the message directly, let the timer do it after the delay you specify. That would make it portable with current tech.
I can't be sure what other implications that might have though, such as in the area of performance and resource usage - I can imagine you wouldn't want to use a timer when you need to send large volumes of messages.In the original requirement, the message is put in the queue immediately by a call to queuesender.send(message) and there's a delivery in delay to a consumer.
Whereas in this solution, the delay is in the message delivery to the queue itself.
IMHO there's a subtle but important difference here.What would for example happen if posting the message to the queue is in the scope of a distributed JTA transaction? You can definitely include the timer call to be in the scope of the transaction, but now you will have to account for the fact and there may be an error when the message is delivered which has to be handled explicitly. In the original scenario the tx would automatically rollback.
cheers,
ram. -
Durable Subscription with MDB in Weblogic 7.0
Hi,
I am using WLS 7.0 as the JMS Provider and as the EJB Container(no
clustering). My question is do I need MDB with durable subscription. I
cannot think of a instance when the container will be down but JMS
provider is still running if I am using WLS as both container and JMS
provider.
One instance i can think of is if the MDB is not deployed (upon a new
release of our application, for some strange reason) but rest of the
application is deployed then the producers will produce messages for
the off-line subscriber.
If I assume that the above is not likely to happen, can you think of
any compelling reason for me to use MDB with durable subcription .
Thanks for your input.
ssahu
1) The MDB should only specify "durable" if it is receiving from a
topic. Durable does not apply to queues.
2) If messages are non-persistent, then you likely don't need durable.
As these messages don't survive the shutdown...
3) Making it durable helps with race-conditions during shutdown or
startup where messages are sent but the MDB isn't up. It also helps
with the condition where shutdown occurs before the MDB finishes
processing all of its messages. (So Durable ensures that the
MDB does not miss a message. It may even help in the non-persistent
case if is possible that the MDB is temporarily undeployed (by you)
while the server is up.
[email protected] wrote:
> Hi,
> I am using WLS 7.0 as the JMS Provider and as the EJB Container(no
> clustering). My question is do I need MDB with durable subscription. I
> cannot think of a instance when the container will be down but JMS
> provider is still running if I am using WLS as both container and JMS
> provider.
> One instance i can think of is if the MDB is not deployed (upon a new
> release of our application, for some strange reason) but rest of the
> application is deployed then the producers will produce messages for
> the off-line subscriber.
>
> If I assume that the above is not likely to happen, can you think of
> any compelling reason for me to use MDB with durable subcription .
>
> Thanks for your input.
>
> ssahu
-
Do I really need two connection pools when using two durable subscriptions?
I have a Spring daemon which takes messages from two different topics and stores them in a database.
What irritates me is that I can't get it to work with a single connection pool. I get a message that I can't create durable subscriptions without a unique client id on the connection. It's not enough that the client id be set on the listener container, I have to set it on the underlying ConnectionFactory. I though this was some kind of glitch with openMQ but activeMQ gives me exactly the same behaviour.
This is the important part of the config
<bean id="realCon" class="org.apache.activemq.ActiveMQConnectionFactory" p:brokerURL="discovery:(multicast://default?group=live)"
p:clientID="DB_RECORD_CLIENT"/>
<bean id="realCon2" class="org.apache.activemq.ActiveMQConnectionFactory" p:brokerURL="discovery:(multicast://default?group=live)"
p:clientID="DB_LOG_CLIENT"/>
<bean id="jmsConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory"
p:targetConnectionFactory-ref="realCon"/>
<bean id="jmsConnectionFactory2" class="org.springframework.jms.connection.CachingConnectionFactory"
p:targetConnectionFactory-ref="realCon2"/>
<bean id="ocsMessageListener" class="com.cc.mer.ordercatcher.MessageReceived"/>
<bean id="logMessageListener" class="com.cc.mer.ordercatcher.LogMessageReceived"/>
<jms:listener-container
connection-factory="jmsConnectionFactory"
destination-type="durableTopic"
transaction-manager="transactionManager"
acknowledge="transacted"
>
<jms:listener ref="ocsMessageListener" destination="OCS_RELAYED"
subscription="ocs.db.recording" />
</jms:listener-container>
<jms:listener-container
connection-factory="jmsConnectionFactory2"
destination-type="durableTopic"
transaction-manager="transactionManager"
acknowledge="transacted"
>
<jms:listener ref="logMessageListener" destination="OCS_LOG"
subscription="ocs.log.recording" />
</jms:listener-container>Thank you all for your replies.
Yesterday, I went back to BestBuy and returned the Gigabit Ethernet Switch and exchanged it for a Belkin Share Max N300 router. I chose this one because I want to use the router in WIRED mode and this had a 10/100/1000Mbps Gigabit Ethernet capability. Most other routers that I looked at only had 10/100Mbps. I also liked that it had two USB ports.
I had to call Belkin tech support because the installer from the included CD would not install the software. Nor would the installer that I downloaded from their web site. I ended up actually having to be taken to the IP address' web site and from there I was able to configure everything.
Although it took me a few hours to get all my other wireless devices onto my wireless network (I have a couple of Airport Express(es) for running "Airplay," and a wifi dongle on my TV), things now seem to be working fine. -
Hi,
My card was stolen and now I have a new one. So I need to change the card information used for my subscription, but I can't. I've been trying for days, using different browsers, computers, etc. Contacted chat support with no results. Who do I need to call to get help updating my credit card?
The message I get is "Card is invalid, please check card details"
I have only 4 days left in my subscription.
Thanks,
ArturoCustomer Service is completely incompetent with this type of issue. You will eventually speak to someone who does not have a good command of English, and judging from the background noise, is sitting in some kind of low cost "boiler room" operation that Adobe noiw considers to be adequate to service their paying customers.
I spent 20 minutes on the phone trying to do the same thing. I have work to do, and eventually had to hang up. The chat line reps have to power to do anything but read from their FAQ cards.
It must be nice to have a virtually monopoly on computer software...you can treat your customers any way you want and not have to suffer any consequences. -
how do I open and use this app after I have paid for my subscription? I previously downloaded Primeir Pro CC for the trial and when I try to open the app it says my trial has ended and there is no other option to sign in and use the app?
Remove all current Adobe software. Download Adobe Cleaner Follow instructions.
-
If I run a small studio with only 3 people, and purchase photoshop CC with individual subscription, can I use it for my studio? Why I ask this is because CC individual license (single app) is cheaper than a subscription for small/medium sized businesses (single app).
Thanks in advance.Hi rohit.c
Yes, that's fine - there is no restriction on using an individual subscription commercially.
The small business teams plans are more expensive as you get additional storage and tools to manage license deployment.
Kind regards
Bev -
Does anyone know how to get Adobe to stop charging for a subscription that is no longer being used?
For full details on cancelling a membership and subscription see the following page:
Cancel your membership or subscription | Creative Cloud
Depending on where you are in your subscription cycle / membership and the type of membership
If you have an individual membership, and opted for the annual membership (lower monthly fee). If you are cancelling in the middle of your membership, then you would be billed 50% of what's left of your membership for the remainder of the year, basically that would then in $$s become more like having taken out a month-by-month membership (higher monthly membership fee).
If you are in the last month of your annual membership or your are on a month-by-month membership, you can log into your creative cloud account, cancel the plan yourself (no additional charges apply), by logging in with your Adobe ID and password, click your name in top left of screen and click on Manage Account. -
Is using MDB valid for my functional requirement?
I am newbie to JMS. I just want to know if I can use MDBs in my following functional requirement :
Each request from a web page, starts a process in my app which in turn posts messages to a topic.
Depending on the content of the message, I need to start different processes for each request. The input params for this new processes come from the earlier web request.
All the requests need to listen to the topic and wait for the message(which is a message like something is COMPLETED) and then after getting this message, the separate processes should start.
Can I use MDBs in this scenario?Hi,
You should use a MDB if your process needs to invoke other Bean operations or if you require concurrent processing of messages. If you only want to achieve concurrent processing of messages, I would recommend the use of a lightweight MDB container like. Fore example, ArjunaMS is shipped with such a container called Message Driven Services container.
Hope it helps
Arnaud -
Using CC for Teams, but cannot open Muse as Subscription expired?
Hey,
I have a CC for teams subscription here at work so shouldn't have any issues opening any of the CC software.
All the other programmes open fine, but Muse says my subscriptiion has expired and has 00 days left.
I have contacted Adobe, last week, and the only suggestions they put forward were broken links, so useless anyway. How can I resolve this?Hi Badger Mike,
Please navigate to ~/Library/Application Support/Adobe/OOBE/opm.db and trash it. Launch Muse and sign in with your Adobe Id to activate.
Enable user Library: http://helpx.adobe.com/x-productkb/global/access-hidden-user-library-files.html.
Regards,
Romit Sinha -
InvalidClientIdException while creating Durable subscription in weblogic
Hi,
We have scenario to create a durable subscription for an MDB. Here application in weblogic is a subscriber to a Topic present on the Progress Sonic. For integrating to independent platforms we are using Foreign Server mechanism under JMS Modules.
For creating durable subscription, we have changed the MDB code . Below is the MDB code,
package com.test;
import java.util.Enumeration;
import javax.annotation.Resource;
import javax.annotation.Resources;
import javax.ejb.MessageDriven;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.ejb.TransactionManagement;
import javax.ejb.TransactionManagementType;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
import javax.ejb.ActivationConfigProperty;
* Message-Driven Bean implementation class for: TestMDB
@MessageDriven(description = "mdb for Airline Schedule Change MDB",
name = "AirlineScheduleMDB",
activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Topic"),
@ActivationConfigProperty(propertyName = "subscriptionDurability",
propertyValue = "Durable")
@TransactionManagement(value = TransactionManagementType.CONTAINER)
@Resources( { @Resource(name = "ConnectionFactoryRef",
mappedName = "TopicConnectionFactory",
type = javax.jms.ConnectionFactory.class) })
public class TestMDB implements MessageListener {
* @see MessageListener#onMessage(Message)
@TransactionAttribute(value = TransactionAttributeType.NOT_SUPPORTED)
public void onMessage(Message message) {
System.out.println("Inside message : ");
try {
Enumeration<Object> messageProperty = message.getPropertyNames();
System.out.println("The request : "+message);
if(message != null){
System.out.println("TestMDB : onMessage : Start");
}else{
System.out.println("Received Input message is empty");
} catch (Exception e) {
System.out.println("Exception Occurred in TestMDB : ");
e.printStackTrace();
System.out.println("TestMDB : onMessage : End.Time taken is :");
Also the following change was included in the weblogic-ejb-jar.xml.
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-ejb-jar
xmlns="http://www.bea.com/ns/weblogic/90"
xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd">
<weblogic-enterprise-bean>
<ejb-name>TestMDB</ejb-name>
<message-driven-descriptor>
<pool>
<initial-beans-in-free-pool>1</initial-beans-in-free-pool>
</pool>
<destination-jndi-name>DurableJNDI</destination-jndi-name>
<connection-factory-jndi-name>TopicConnectionFactory</connection-factory-jndi-name>
<jms-polling-interval-seconds>30</jms-polling-interval-seconds>
<generate-unique-jms-client-id>true</generate-unique-jms-client-id>
<jms-client-id>DurableTest</jms-client-id>
</message-driven-descriptor>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
Exception we got :
<03-Apr-2012 18:11:02 o'clock UTC> <Warning> <EJB> <BEA-010061> <The Message-Driven EJB: TestMDB is unable to connect to the JMS destination: DurableJNDI. The Error was:
javax.jms.InvalidClientIDException: Invalid client id: DurableTest_drdevwls_TestDomain-wls1_CLEARCF.jarTestMDB
Weblogic is automatically creating a unique id based on the combination of Adminserver/Managedserver/Projectname etc.
However the id created by weblogic seems to have a dot(.) which as per Sonic spec is an invalid character.
eg:- DurableTest_test_domain_AdminServer_CLEARCF.jarTestMDB
Hence we changed the parameter to false and provided our own value.
<generate-unique-jms-client-id>false</generate-unique-jms-client-id>
<jms-client-id>DurableTest</jms-client-id>
At this point of time we were able to see that MDB have created a Durable subscription successfully and it worked as expected.
However when we tried to scale this change to multiple managed servers, there were errors thrown from sonic side.
javax.jms.JMSException: [129] progress.message.client.EUserAlreadyConnected: Administrator/$DURABLE$DurableTest$DurableTest
So we cannot have same clientid for multiple clients(managed server). We arent sure how to proceed with this.
We need to find a way to remove the dot from the dynamic id weblogic creates.
Any help on this is highly appreciated.Hi Tom,
We have found the solution to this problem and thanks for your suggestion that has partially helped us in solving the problem.
As you have suggested we have defined client-id on the connection factory however we will be having only connection factory instead of multiple with different client-ID's.
Along with the client-id configured at the connection factory level we are now setting the attributes generate-unique-client-id as true at the weblogic end.
By doing this way, I assume that weblogic while making the durable subscription connection is passing the uniquely generated client ID (which has dots '.' included in it ) as subscription name and client-id will be same, that is defined on the connection factory.
A question may arise that - 'why is sonic accepting subscription name with dots but not the client-id ?' - When observed from the sonic end the dots in the subscription name are replaced by '@@@' .
Sonic need to answer the question of why the dots are being replaced for subscription name but not for client-id.
Regards,
Bharat K -
How to configure MDB as Durable Subscriber
I can't seem to find any documentation on how to set up an MDB as a Durable Subscriber.
I tried using the Edit EJB Descriptor link in the console. I then drilled down
to Message Driven Destination. For Subscription Durability, I selected Durable.
I clicked Apply. I also went back to the jar and pressed the Persist button to
"Persist changes made to the Descriptor(s)".
I check the Topic to see if there were any Durable Subscribers listed. No. I bounced
the server. Still no.
What am I missing? The only info I can find in the documentation about setting
up Durable Subscriptions is via the JMS API (http://e-docs.bea.com/wls/docs61/jms/implement.html#1097632)
Using WL v6 SP5, not clustered.
Any help would be appreciated.
Jim
Hi James,
I'm unfamiliar with the console ejb xml editor. I suggest
posting to the ejb newsgbroup, which is more familiar
with these things. Meanwhile, the attached notes
and the following example may help if your willing
to hand-edit the xml.
Tom, BEA
<ejb-jar>
<enterprise-beans>
<message-driven>
<ejb-name>exampleMessageDrivenA</ejb-name>
<ejb-class>MessageBean</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
<!--
<destination-type>javax.jms.Topic</destination-type>
<subscription-durability>Durable</subscription-durability>
-->
</message-driven-destination>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>exampleMessageDrivenA</ejb-name>
<method-name>onMessage()</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
<!-- Sample MessageDriven bean Weblogic deployment descriptor -->
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>exampleMessageDrivenA</ejb-name>
<message-driven-descriptor>
<pool>
<max-beans-in-free-pool>5</max-beans-in-free-pool>
<initial-beans-in-free-pool>5</initial-beans-in-free-pool>
</pool>
<!--
<destination-jndi-name>quotestopic</destination-jndi-name>
-->
<destination-jndi-name>MDBQ</destination-jndi-name>
<!--
<provider-url>t3://localhost:10001</provider-url>
<connection-factory-jndi-name>cf3</connection-factory-jndi-name>
<jms-client-id>cid444</jms-client-id>
-->
</message-driven-descriptor>
<jndi-name>someid</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
James Goodwin wrote:
> I can't seem to find any documentation on how to set up an MDB as a Durable Subscriber.
> I tried using the Edit EJB Descriptor link in the console. I then drilled down
> to Message Driven Destination. For Subscription Durability, I selected Durable.
> I clicked Apply. I also went back to the jar and pressed the Persist button to
> "Persist changes made to the Descriptor(s)".
>
> I check the Topic to see if there were any Durable Subscribers listed. No. I bounced
> the server. Still no.
>
> What am I missing? The only info I can find in the documentation about setting
> up Durable Subscriptions is via the JMS API (http://e-docs.bea.com/wls/docs61/jms/implement.html#1097632)
>
> Using WL v6 SP5, not clustered.
>
> Any help would be appreciated.
>
> Jim
A durable topic subscriber MDB uses its name to generate its client-id.
Since JMS enforces uniqueness on this client-id, this means that if a durable
subscriber MDB is deployed to multiple servers only one server will be able
to connect. Some applications want a different behavior where
each MDB pool on each server gets its own durable subscription.
The MDB durable subscription id, which must be unique on its topic, comes from:
1) <jms-client-id>MyClientID</jms-client-id>
(the weblogic dtd)
2) if (1) is not set then the client-id
comes from the ejb name.
The durable subscription is uniquely identified within a cluster by a
combination of "connection-id" and "subscription-id". Only one active
connection may use a particular "connection-id" within a WebLogic cluster.
The connection id comes from:
1) The "ClientId" attribute configured on the WebLogic connection factory.
This defaults to null. Note that if the ClientId is set on a connection
factory, only one connection created by the factory
may be active at a time.
2) If (1) is not set, then, as with the subscriber-id,
the connection-id is derived from jms-client-id descriptor attribute:
<jms-client-id>MyClientID</jms-client-id>
(the weblogic dtd)
3) If (1) and (2) are not set, then, as with the subscriber-id,
the connection-id is derived from the ejb name.
Work-around:
A) Create a custom connection-factory for each server:
1) configure "JNDIName" to the same value across all servers
("myMDBCF" in this example)
2) configure "ClientId" to a unique value per server
3) enable "UserTransactionsEnabled"
4) enable "XAConnectionFactoryEnabled"
5) set "AcknowledgePolicy" to "ACKNOWLEDGE_PREVIOUS"
6) target the CF at a single WebLogic server
(Number 5 is required for non-transactional topic MDBs)
B) In the MDB's weblogic-ejb-jar.xml descriptor, set the MDB's connection
factory to the JNDI name of the custom connection factories configured in
(A). Optionally, also specify the subscriber-id via the jms-client-id
attribute.
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>exampleBean</ejb-name>
<message-driven-descriptor>
<connection-factory-jndi-name>myMDBCF</connection-factory-jndi-name>
<jms-client-id>myClientID</jms-client-id>
</message-driven-descriptor>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
C) Target the application at the same servers that have the custom connection
factories targeted at them.
Notes/Limitations:
1) If the MDB is moved from one server to another, the MDB's corresponding
connection-factory must be moved with it.
2) This work-around will not work if the destination is not in the same
cluster as the MDB. (The MDB can not use the local connection factory, which
contains the connection-id, as connection factories do not work unless they
are in the same cluster as the destination.)
3) This work-around will not work for non-WebLogic JMS topics.
-
Error destination for durable subscribers
We want to use the publish/subscribe mechanism for application
integration purposes. We have one application publishing a message on
a topic and multiple application that have a durable subscription on
that topic.
We want to control the redelivery process for an individual
subscriber. When the number of retries is exceeded for a particular
message it is sent to the error destination for that application. This
allows us to fix the problem in the application (whatever it was) and
resubmit the message to the application.
We can set the Error Destination and control the redelivery process
for both Topics and Queue. But is it also possible to define an error
destination and redelivery process for individual durable
subscriptions?
Cheers,
Mark van Holsteijn
PS: My reference material is MQ en TUXEDO/Q. In both MQ and TUXEDO/Q
you subscribe a specific Queue to a topic giving you both an error
destination and redelivery control.
Mark van Holsteijn wrote:
> Tom,
>
> Thanks for the swift confirmation. Would it not be a handy enhancement
> to the WebLogic JMS provider?
>
> About TUXEDO: tpsubscribe() lets you subscribe a queue in a queue space
> to an event using the option TPEVQUEUE. See
> http://edocs.bea.com/tuxedo/tux81/rf3c/rf3c81.htm#1045667
>
That isn't really the same animal as pub/sub - the above call redirects
an event subscription to a particular Q, where each Q has to be manually
configured. If my understanding is correct,
you could emulate the same thing in WebLogic with just a little
bit of work: configure multiple queues, and write an EJB
method that redirects information to a particular Q based on the value
of one of its parameters (or write an MDB that does a similar
thing.)
> Cheers,
>
> Mark
>
>
> Tom Barnes wrote:
>
>> Mark van Holsteijn wrote:
>>
>>> We want to use the publish/subscribe mechanism for application
>>> integration purposes. We have one application publishing a message on
>>> a topic and multiple application that have a durable subscription on
>>> that topic.
>>>
>>> We want to control the redelivery process for an individual
>>> subscriber. When the number of retries is exceeded for a particular
>>> message it is sent to the error destination for that application. This
>>> allows us to fix the problem in the application (whatever it was) and
>>> resubmit the message to the application.
>>>
>>> We can set the Error Destination and control the redelivery process
>>> for both Topics and Queue. But is it also possible to define an error
>>> destination and redelivery process for individual durable
>>> subscriptions?
>>
>>
>>
>> No.
>>
> Thanks for the confirmation.
>
>>>
>>>
>>> Cheers,
>>>
>>> Mark van Holsteijn
>>>
>>> PS: My reference material is MQ en TUXEDO/Q. In both MQ and TUXEDO/Q
>>> you subscribe a specific Queue to a topic giving you both an error
>>> destination and redelivery control.
>>>
>>
>> I think I know what you are referring to in MQ,
>> but Tux/Q has no pub/sub capability.
>>
>
> Chec
>
>> Tom, BEA
>>
>
-
Topic with Durable Subscription Questions...
Hello all,
The scenario: WL 7.0 - sp2, a clustered environment. I have a JMS Topic which
has one MsgBean that is Durable and one MsgBean that is non-durable consuming
messages off this Topic. Both MsgBeans are deployed on all machines in the cluster,
and the server (which contains the topic) is targetted to one machine.
The issue that I am experiencing is that the DurableMsgBean can not connect to
the jms topic, but the non-durable one gets its messages all the time.
Any ideas/suggestions?
C.
Hi,
The durable subscriber name is derived from the descriptor's ejb name,
and only one consumer may attach to a particular durable subscription
at a time. I've attached some notes that should help you out, please
excuse the jumbled formatting.
Let me know if this helps,
Tom, BEA
The durable subscription is uniquely identified within a cluster by a
combination of "connection-id" and "subscription-id". Only one active
connection may use a particular "connection-id" within a WebLogic cluster.
The durable subscription id, which must be unique on its topic, comes from:
1) <jms-client-id>MyClientID</jms-client-id>
(the weblogic dtd)
2) if (1) is not set then the client-id
comes from the ejb name.
The connection id comes from:
1) The "ClientId" attribute configured on the WebLogic
connection factory.
This defaults to null. Note that if the ClientId is set on
a connection
factory, only one connection created by the factory
may be active at a time.
2) If (1) is not set, then, as with the subscriber-id,
the connection-id is derived from jms-client-id descriptor attribute:
<jms-client-id>MyClientID</jms-client-id>
(the weblogic dtd)
3) If (1) and (2) are not set, then, as with the subscriber-id,
the connection-id is derived from the ejb name.
Work-around:
A) Create a custom connection-factory for each server:
1) configure "JNDIName" to the same value across all servers
("myMDBCF" in this example)
2) configure "ClientId" to a unique value per server
3) enable "UserTransactionsEnabled"
4) enable "XAConnectionFactoryEnabled"
5) set "AcknowledgePolicy" to "ACKNOWLEDGE_PREVIOUS"
6) target the CF at a single WebLogic server
(Number 5 is required for non-transactional topic MDBs)
B) In the MDB's weblogic-ejb-jar.xml descriptor, set the MDB's
connection factory to the JNDI name of the custom connection factories
configured in (A). Optionally, also specify the subscriber-id via the
jms-client-id attribute.
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>exampleBean</ejb-name>
<message-driven-descriptor>
<connection-factory-jndi-name>myMDBCF</connection-factory-jndi-name>
<jms-client-id>myClientID</jms-client-id>
</message-driven-descriptor>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
C) Target the application at the same servers that have the custom
connection factories targeted at them.
Notes/Limitations:
1) If the MDB is moved from one server to another, the MDB's
corresponding connection-factory must be moved with it.
2) This work-around will not work if the destination is not in the same
cluster as the MDB. (The MDB can not use the local connection factory,
which
contains the connection-id, as connection factories do not work unless they
are in the same cluster as the destination.)
3) This work-around will not work for non-WebLogic JMS topics.
csw wrote:
> Hello all,
>
> The scenario: WL 7.0 - sp2, a clustered environment. I have a JMS Topic which
> has one MsgBean that is Durable and one MsgBean that is non-durable consuming
> messages off this Topic. Both MsgBeans are deployed on all machines in the cluster,
> and the server (which contains the topic) is targetted to one machine.
>
> The issue that I am experiencing is that the DurableMsgBean can not connect to
> the jms topic, but the non-durable one gets its messages all the time.
>
> Any ideas/suggestions?
>
> C.
>
Maybe you are looking for
-
How to get web application to use Tuscany without conflicting with SAP SDO
Hi, We are attempting to run a web application on SAP NetWeaver CE 7.1 SP1 which uses Tuscany SDO. As it now stands We must use Tuscany because the web application will not run with the SAP SDO implementation provided by Netweaver. To ensure that Tu
-
Adobe Reader on a Solaris 10 SPARC machine
Hi, Can anyone tell me if Adobe's Vulnerability ID: APSB11-03 is applicable to Reader 8.1.7. That is the version of Reader that is installed be default with the latest version of Solaris 10 for SPARC platforms. Thanks.
-
Hi, I am getting the below error while executing PS.Anybody experienced the same? what could be the reason? Best Regards, Arun http://whynotsql.blogspot.com/
-
I cannot get to the page where you can start sync and all other options, but my phone is recognized.
-
Help needed please! With my work email i'm unable to send reply email to colleagues off my iphone. I can from macbook. I receive the following message: Cannot Send Mail, A copy has been placed in your Outbox. The recipient "<colleague's email>" was