If you create a non durable subscriber it will only receive messages that are sent while that subscriber exists. That is *as per JMS spec*.
If you want to receive messages that were sent while the subscriber is not is connected, you need to use a durable subscriber.
Again, I would suggest reading the JMS spec for an understanding of the differences between durable and non durable subscribers.
I am using point to point model.
So i am using queue (there is no durable subscriber)
If we use Topic also for Durable then its same as Queue with persistance.
So when my consumer is down it is getting saved in the database and the next time i am starting my consumer , i am able to get those messages.
but my problem was the order as i mentioned.
Durability ensures that you will lose messages.
Or you want to say if we use durable topic subscriber,
-> produce the 10,000 message when consumer is not running.
-> stop the producer.
-> now start the consumer and producer at the same time.
-> and i will get previous message first then the messages which
being produced by the recent producer. (and thus ensuring the older
messages are coming first. )
I am failing to understand what this thread is about.
JBM fully supports all ordering semantics as defined in the JMS spec.
-->My producer is sending Message M1,M2,M3 to a queue /queue/q1
-->no consumer is running that time, so i see M1,M2,M3 in mysql data base.
--> I started my producer to send messages M4,M5,M6 and at the same
time i started my consumer too.
--> So in the consumer i see the messages M4,M5,M6 first followed by M1,M2,M3(that means it is taking the messages from the memory first rather than persistent data base)
--> is there any mechanism that ensures that i get M1,M2,M3,M4,M5 then M6
(i.e. old message first)
That should certainly never happen.
JBM will (as per JMS spec) always deliver messages in the order they were sent from a particular producer.
Please post a simple test case demonstrating the issue. Also please mention what version of JBM you are using.
It seems it was confusion created for few people using the same queue.
So "Messages are coming in Order Only according to JMS spec"
I have done a comparative study of JBM and ActiveMQ for past two month.
And The Result is JBM Rocks..
We will use JBM for our project now.
Getting curious: You did a comparative study of JBM and ActiveMQ. I'm doing the same exercise right now, would you be so kind to share your results with other people like me?