You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by dantelope <da...@gmail.com> on 2007/09/24 21:56:30 UTC

Virtual Topic not working as expected - defect, or misunderstanding?

The following test produces unexpected results:

1) Start a broker with a statically defined destination topic called
VirtualTopic.FOO
2) Start a consumer listening to Consumer.A.VirtualTopic.FOO
3) Start a sender and send N messages to VirtualTopic.FOO
4) Consumer correctly receives N messages.
5) Kill the consumer process
6) Stop the broker
7) Start the broker
8) Start a sender and send N messages to VirtualTopic.FOO
9) Start a consumer listening to Consumer.A.VirtualTopic.FOO

FAIL: the consumer does not receive N messages as expected.

If I put messages on the topic before stopping the server, then the consumer
WILL receive the messages on start up.

Is this my misunderstanding of how Virtual Topics should work, or is this a
defect I should report?

Also: as a workaround, anyone have any experience using Composite
Destinations to mimic the virtual topics -- sending to a queue which sends
to registered queues internally (and hopefully putting some kind of
low-limit policy for retaining messages on the top-level queue)?

Thanks,
Dan
-- 
View this message in context: http://www.nabble.com/Virtual-Topic-not-working-as-expected---defect%2C-or-misunderstanding--tf4511392s2354.html#a12867038
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Virtual Topic not working as expected - defect, or misunderstanding?

Posted by ttmdev <jo...@ttmsolutions.com>.
Did not work on my 4.1.1 drop, so it does indeed appear to be a bug with 4.1. 

Joe


ttmdev wrote:
> 
> I am using a recent 5.0 SNAPSHOT and just for grins decided to give your
> test a whirl. I followed your steps 1 thru 9 and AMQ worked as it should.
> No problema!
> 
> If time allows, I'll give 4.1.1 a whirl today and see what happens. 
> 
> Regards,
> Joe
> 
> 
> dantelope wrote:
>> 
>> I'm going to go ahead and say this a defect in 4.1  Virtual Topics appear
>> to have lost the expected functionality of permanent registration -- that
>> is, it fails the rule "once I register, give me all messages sent to the
>> topic until I unregister". 
>> 
>> I would love to be proved wrong because we truly need the ability to
>> scale consumers by competing for messages on the queue, but if the broker
>> goes down and we lose messages until we re-register then something is
>> wrong.  I shouldn't have to statically define every single client queue. 
>> That's not how it works in durable subscriptions, and it's not how it
>> should work in virtual topics.
>> 
>> Does anyone have a test that counters this?
>> 
>> 
>> James.Strachan wrote:
>>> 
>>> On 24/09/2007, dantelope <da...@gmail.com> wrote:
>>>>
>>>> The following test produces unexpected results:
>>>>
>>>> 1) Start a broker with a statically defined destination topic called
>>>> VirtualTopic.FOO
>>>> 2) Start a consumer listening to Consumer.A.VirtualTopic.FOO
>>>> 3) Start a sender and send N messages to VirtualTopic.FOO
>>>> 4) Consumer correctly receives N messages.
>>>> 5) Kill the consumer process
>>>> 6) Stop the broker
>>>> 7) Start the broker
>>>> 8) Start a sender and send N messages to VirtualTopic.FOO
>>>> 9) Start a consumer listening to Consumer.A.VirtualTopic.FOO
>>>>
>>>> FAIL: the consumer does not receive N messages as expected.
>>>>
>>>> If I put messages on the topic before stopping the server, then the
>>>> consumer
>>>> WILL receive the messages on start up.
>>>>
>>>> Is this my misunderstanding of how Virtual Topics should work, or is
>>>> this a
>>>> defect I should report?
>>> 
>>> Are you sending the messages using persistent mode?
>>> http://activemq.apache.org/what-is-the-difference-between-persistent-and-non-persistent-delivery.html
>>> 
>>> If not then its expected behaviour.
>>> 
>>> Note that to re-enable the consumer each time you need to start the
>>> consumer on startup of the broker or add the
>>> Consumer.A.VirtualTopic.FOO queue to the startup destinations.
>>> 
>>> http://activemq.apache.org/configure-startup-destinations.html
>>> -- 
>>> James
>>> -------
>>> http://macstrac.blogspot.com/
>>> 
>>> Open Source SOA
>>> http://open.iona.com
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Virtual-Topic-not-working-as-expected---defect%2C-or-misunderstanding--tf4511392s2354.html#a12908113
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Virtual Topic not working as expected - defect, or misunderstanding?

Posted by ttmdev <jo...@ttmsolutions.com>.
I am using a recent 5.0 SNAPSHOT and just for grins decided to give your test
a whirl. I followed your steps 1 thru 9 and AMQ worked as it should. No
problema!

If time allows, I'll give 4.1.1 a whirl today and see what happens. 

Regards,
Joe


dantelope wrote:
> 
> I'm going to go ahead and say this a defect in 4.1  Virtual Topics appear
> to have lost the expected functionality of permanent registration -- that
> is, it fails the rule "once I register, give me all messages sent to the
> topic until I unregister". 
> 
> I would love to be proved wrong because we truly need the ability to scale
> consumers by competing for messages on the queue, but if the broker goes
> down and we lose messages until we re-register then something is wrong.  I
> shouldn't have to statically define every single client queue.  That's not
> how it works in durable subscriptions, and it's not how it should work in
> virtual topics.
> 
> Does anyone have a test that counters this?
> 
> 
> James.Strachan wrote:
>> 
>> On 24/09/2007, dantelope <da...@gmail.com> wrote:
>>>
>>> The following test produces unexpected results:
>>>
>>> 1) Start a broker with a statically defined destination topic called
>>> VirtualTopic.FOO
>>> 2) Start a consumer listening to Consumer.A.VirtualTopic.FOO
>>> 3) Start a sender and send N messages to VirtualTopic.FOO
>>> 4) Consumer correctly receives N messages.
>>> 5) Kill the consumer process
>>> 6) Stop the broker
>>> 7) Start the broker
>>> 8) Start a sender and send N messages to VirtualTopic.FOO
>>> 9) Start a consumer listening to Consumer.A.VirtualTopic.FOO
>>>
>>> FAIL: the consumer does not receive N messages as expected.
>>>
>>> If I put messages on the topic before stopping the server, then the
>>> consumer
>>> WILL receive the messages on start up.
>>>
>>> Is this my misunderstanding of how Virtual Topics should work, or is
>>> this a
>>> defect I should report?
>> 
>> Are you sending the messages using persistent mode?
>> http://activemq.apache.org/what-is-the-difference-between-persistent-and-non-persistent-delivery.html
>> 
>> If not then its expected behaviour.
>> 
>> Note that to re-enable the consumer each time you need to start the
>> consumer on startup of the broker or add the
>> Consumer.A.VirtualTopic.FOO queue to the startup destinations.
>> 
>> http://activemq.apache.org/configure-startup-destinations.html
>> -- 
>> James
>> -------
>> http://macstrac.blogspot.com/
>> 
>> Open Source SOA
>> http://open.iona.com
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Virtual-Topic-not-working-as-expected---defect%2C-or-misunderstanding--tf4511392s2354.html#a12907317
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Virtual Topic not working as expected - defect, or misunderstanding?

Posted by dantelope <da...@gmail.com>.
I'm going to go ahead and say this a defect in 4.1  Virtual Topics appear to
have lost the expected functionality of permanent registration -- that is,
it fails the rule "once I register, give me all messages sent to the topic
until I unregister". 

I would love to be proved wrong because we truly need the ability to scale
consumers by competing for messages on the queue, but if the broker goes
down and we lose messages until we re-register then something is wrong.  I
shouldn't have to statically define every single client queue.  That's not
how it works in durable subscriptions, and it's not how it should work in
virtual topics.

Does anyone have a test that counters this?


James.Strachan wrote:
> 
> On 24/09/2007, dantelope <da...@gmail.com> wrote:
>>
>> The following test produces unexpected results:
>>
>> 1) Start a broker with a statically defined destination topic called
>> VirtualTopic.FOO
>> 2) Start a consumer listening to Consumer.A.VirtualTopic.FOO
>> 3) Start a sender and send N messages to VirtualTopic.FOO
>> 4) Consumer correctly receives N messages.
>> 5) Kill the consumer process
>> 6) Stop the broker
>> 7) Start the broker
>> 8) Start a sender and send N messages to VirtualTopic.FOO
>> 9) Start a consumer listening to Consumer.A.VirtualTopic.FOO
>>
>> FAIL: the consumer does not receive N messages as expected.
>>
>> If I put messages on the topic before stopping the server, then the
>> consumer
>> WILL receive the messages on start up.
>>
>> Is this my misunderstanding of how Virtual Topics should work, or is this
>> a
>> defect I should report?
> 
> Are you sending the messages using persistent mode?
> http://activemq.apache.org/what-is-the-difference-between-persistent-and-non-persistent-delivery.html
> 
> If not then its expected behaviour.
> 
> Note that to re-enable the consumer each time you need to start the
> consumer on startup of the broker or add the
> Consumer.A.VirtualTopic.FOO queue to the startup destinations.
> 
> http://activemq.apache.org/configure-startup-destinations.html
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source SOA
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Virtual-Topic-not-working-as-expected---defect%2C-or-misunderstanding--tf4511392s2354.html#a12905702
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Virtual Topic not working as expected - defect, or misunderstanding?

Posted by dantelope <da...@gmail.com>.

James.Strachan wrote:
> 
> Note that to re-enable the consumer each time you need to start the
> consumer on startup of the broker or add the
> Consumer.A.VirtualTopic.FOO queue to the startup destinations.
> 

James -- since Virtual Topics were designed to get around durable
subscription limitations, I would assume it would carry the same semantic. 
Regardless whether I "re-start" the consumer or not, if I have registered an
interest in FOO at some point, I should never lose any messages sent to FOO. 
So if the broker goes down and comes up and someone sends messages to FOO
and then I come along as a consumer and say "I am back, can I see what's new
on FOO?" I should absolutely get the messages... however, as it is right now
in 4.1, it is as if the broker is treating consumer queues as
temporary/non-durable -- they are relevant only through the life of the
broker.

Since this differs from durable topic semantics, I'd say this is indeed a
defect.

Interestingly, it may have been fixed in the 5.x tree... perhaps we can
backport the fix (if I knew where it was) to 4.1.

Dan
-- 
View this message in context: http://www.nabble.com/Virtual-Topic-not-working-as-expected---defect%2C-or-misunderstanding--tf4511392s2354.html#a12906636
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Virtual Topic not working as expected - defect, or misunderstanding?

Posted by dantelope <da...@gmail.com>.
Hi, James - thanks for the quick reply.

I had not started it in persistent mode and I was not statically defining
the consumer queue.  However, upon doing that the same results apply.

I *should* be able to start this broker, send messages to the topic, bring
down the broker, bring up the broker, and retrieve the messages.

Does it matter how the broker is brought down?  I'm doing it as harshly as I
can to simulate removal of power...


Broker Configuration Snippet:
------------------------------------------------------------------------------------------
<destinations>
  <topic physicalName="VirtualTopic.FOO"/>
  <queue physicalName="Consumer.dantelope.VirtualTopic.FOO"/>
</destinations>

Producer Snippet:
------------------------------------------------------------------------------------------
ConnectionFactory factory = new ActiveMQConnectionFactory(
"tcp://localhost:61616" );
Connection conn = factory.createConnection();
Session session = conn.createSession( false, Session.CLIENT_ACKNOWLEDGE );
TextMessage msg = session.createTextMessage( "Hello, world!" );
MessageProducer prod = session.createProducer( new ActiveMQTopic(
"Consumer.dantelope.VirtualTopic.FOO" ) );
prod.setDeliveryMode( DeliveryMode.PERSISTENT );
prod.send( msg );




James.Strachan wrote:
> 
> Are you sending the messages using persistent mode?
> http://activemq.apache.org/what-is-the-difference-between-persistent-and-non-persistent-delivery.html
> 
> If not then its expected behaviour.
> 
> Note that to re-enable the consumer each time you need to start the
> consumer on startup of the broker or add the
> Consumer.A.VirtualTopic.FOO queue to the startup destinations.
> 
> http://activemq.apache.org/configure-startup-destinations.html
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source SOA
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Virtual-Topic-not-working-as-expected---defect%2C-or-misunderstanding--tf4511392s2354.html#a12881785
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Virtual Topic not working as expected - defect, or misunderstanding?

Posted by James Strachan <ja...@gmail.com>.
On 24/09/2007, dantelope <da...@gmail.com> wrote:
>
> The following test produces unexpected results:
>
> 1) Start a broker with a statically defined destination topic called
> VirtualTopic.FOO
> 2) Start a consumer listening to Consumer.A.VirtualTopic.FOO
> 3) Start a sender and send N messages to VirtualTopic.FOO
> 4) Consumer correctly receives N messages.
> 5) Kill the consumer process
> 6) Stop the broker
> 7) Start the broker
> 8) Start a sender and send N messages to VirtualTopic.FOO
> 9) Start a consumer listening to Consumer.A.VirtualTopic.FOO
>
> FAIL: the consumer does not receive N messages as expected.
>
> If I put messages on the topic before stopping the server, then the consumer
> WILL receive the messages on start up.
>
> Is this my misunderstanding of how Virtual Topics should work, or is this a
> defect I should report?

Are you sending the messages using persistent mode?
http://activemq.apache.org/what-is-the-difference-between-persistent-and-non-persistent-delivery.html

If not then its expected behaviour.

Note that to re-enable the consumer each time you need to start the
consumer on startup of the broker or add the
Consumer.A.VirtualTopic.FOO queue to the startup destinations.

http://activemq.apache.org/configure-startup-destinations.html
-- 
James
-------
http://macstrac.blogspot.com/

Open Source SOA
http://open.iona.com