Appart from following the instructions below, there is a known problem
with durable stuff, where JBossMQ seems to stuff messages into the MDB
container before it has started the JMS connection. Normaly this means
that messages sent during downtime will be delivered when new messages
is comming into the message driven bean (the session sort of have the
messages cached). This is described in a mail on the JBossMQ
mailinglist, but non of the JBossMQ programmers have commented on it:
http://groups.yahoo.com/group/spyderMQ/message/952
(I think access to the archive is closed to list members).
Strangely enough it works if the MDB is one JBoss instance and the
durable topic is subscribes on is in another JBoss instance (how to
configure such a setup is covered in the manual)
//Peter
On 25 Maj, Per Lewau wrote:
>
> On Fri, 25 May 2001, Howard Ginsburg wrote:
>
>> I tried using a topic instead and am getting the same failed persistence.
>> The jbossmq file for my topic does grow in size, but the messages never get
>> sent to my mdb when the server restarts. Any additional thoughts would be
>> greatly appreciated.
>
>
> Have you set a client id for the MDB? You must use a client id with a
> durable subscription.
>
> See: http://jboss.org/documentation/HTML/ch07s07.html
>
> <quote>
> It is also possible to use a name and a password to log in to JBossMQ.
> These may be used by them self. If you have specified a Durable Topic they
> are however required. Then one also have to specify a client-id. All these
> stuff are configurable in conf/default/jbossmq.xml. Using one of the
> default in that file we could have a deployment descriptor looking like
> this:
>
> <message-driven>
> <ejb-name>DurableTopicBean</ejb-name>
> <configuration-name>Standard Message Driven
> Bean</configuration-name>
>
> <destination-jndi-name>topic/testDurableTopic</destination-jndi-name>
> <mdb-user>john</mdb-user>
> <mdb-passwd>needle</mdb-passwd>
> <mdb-client-id>DurableSubscriberExample</mdb-client-id>
> </message-driven>
> </quote>
>
>
>
>>
>> -----Original Message-----
>> From: Ginsburg, Howard [mailto:[EMAIL PROTECTED]]
>> Sent: Thursday, May 24, 2001 12:46 PM
>> To: [EMAIL PROTECTED]
>> Subject: RE: [JBoss-user] Persistence Queue with Message Driven Bean
>>
>>
>> I am using JBoss 2.2.1. Here is some sample code from my client:
>>
>> //Get a handle to the JMS queue.
>> Context context = new InitialContext();
>>
>> String QUEUE_FACTORY = "QueueConnectionFactory";
>> QueueConnectionFactory queueFactory =
>> (QueueConnectionFactory)context.lookup(QUEUE_FACTORY);
>> queueConnection = queueFactory.createQueueConnection();
>>
>> session =
>> queueConnection.createQueueSession(false,javax.jms.Session.AUTO_ACKNOWLEDGE)
>> ;
>> Queue queue = (Queue)context.lookup("queue/MyQueue");
>>
>> sender = session.createSender(queue);
>>
>> //Create a message object to use.
>> ObjectMessage message = session.createObjectMessage();
>>
>> //Set the message.
>> message.setObject(MySerializableObject);
>>
>> //Send the message.
>> sender.send(message);
>>
>> -----Original Message-----
>> From: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED]]On Behalf Of Rama Rao
>> Sent: Thursday, May 24, 2001 11:47 AM
>> To: [EMAIL PROTECTED]
>> Subject: Re: [JBoss-user] Persistence Queue with Message Driven Bean
>>
>>
>> Hi,
>> That is the way it should work. Once you restart the server it should
>> process all the messages. That is happening with us.
>> Your XMLs seems to be OK. Which version of JBoss you are using?
>> Can u post the few lines of code which puts the messages in queue?
>> bye
>> rama rao
>> ----- Original Message -----
>> From: Howard Ginsburg <[EMAIL PROTECTED]>
>> To: <[EMAIL PROTECTED]>
>> Sent: Thursday, May 24, 2001 8:14 PM
>> Subject: [JBoss-user] Persistence Queue with Message Driven Bean
>>
>>
>> > I have my client send messages to a persistent queue, then have a mdb
>> > listening on that queue. At runtime, everything seems to work correctly.
>> I
>> > am now trying to verify the persistence of the queue. To do this, I
>> remove
>> > the mdb from my deployment, send messages from my client, shutdown jboss,
>> > redeploy my mdb, and restart jboss. My understanding is that the messages
>> > should automatically get restored and triggered to my mdb. This isn't the
>> > behavior I get. It appears the messages are lost. Any thoughts? Here is
>> > my configuration:
>> >
>> > ejb-jar.xml
>> >
>> > <?xml version="1.0"?>
>> > <!DOCTYPE ejb-jar>
>> > <ejb-jar>
>> > <enterprise-beans>
>> > <message-driven>
>> > <ejb-name>MDBBean</ejb-name>
>> > <ejb-class>com.test.MDBBean</ejb-class>
>> > <message-selector></message-selector>
>> > <transaction-type>Container</transaction-type>
>> > <acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
>> > <message-driven-destination>
>> > <destination-type>javax.jms.Queue</destination-type>
>> > <subscription-durability>Durable</subscription-durability>
>> > </message-driven-destination>
>> > </message-driven>
>> >
>> > </enterprise-beans>
>> > <assembly-descriptor>
>> > <container-transaction>
>> > <method>
>> > <ejb-name>MDBBean</ejb-name>
>> > <method-name>*</method-name>
>> > </method>
>> > <trans-attribute>Required</trans-attribute>
>> > </container-transaction>
>> >
>> > </assembly-descriptor>
>> > </ejb-jar>
>> >
>> > jboss.xml
>> >
>> > <?xml version="1.0" encoding="Cp1252"?>
>> >
>> > <jboss>
>> > <enterprise-beans>
>> >
>> > <message-driven>
>> > <ejb-name>MDBBean</ejb-name>
>> > <configuration-name></configuration-name>
>> > <destination-jndi-name>queue/MyQueue</destination-jndi-name>
>> > </message-driven>
>> >
>> > </enterprise-beans>
>> > </jboss>
>> >
>> > jbossmq.xml
>> >
>> > <Queue>
>> > <Name>MyQueue</Name>
>> > </Queue>
>> >
>> > _______________________________________________
>> > JBoss-user mailing list
>> > [EMAIL PROTECTED]
>> > http://lists.sourceforge.net/lists/listinfo/jboss-user
>>
>>
>> _______________________________________________
>> JBoss-user mailing list
>> [EMAIL PROTECTED]
>> http://lists.sourceforge.net/lists/listinfo/jboss-user
>>
>> _______________________________________________
>> JBoss-user mailing list
>> [EMAIL PROTECTED]
>> http://lists.sourceforge.net/lists/listinfo/jboss-user
>>
>> _______________________________________________
>> JBoss-user mailing list
>> [EMAIL PROTECTED]
>> http://lists.sourceforge.net/lists/listinfo/jboss-user
>>
>
> -----------------------------------------------------------------------
> Per Lewau ([EMAIL PROTECTED])
>
> "Why waste time learning, when ignorance is instantaneous?"
> - Hobbes
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
--
------------------------------------------------------------
Peter Antman Technology in Media, Box 34105 100 26 Stockholm
Systems Architect WWW: http://www.tim.se
Email: [EMAIL PROTECTED] WWW: http://www.backsource.org
Phone: +46-(0)8-506 381 11 Mobile: 070-675 3942
------------------------------------------------------------
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user