You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by bansalp <bp...@gmail.com> on 2014/09/29 13:36:33 UTC

Who will receive messages first virtual topic subscriber or logical queue consumer?

Hi,

I am trying to use virtual topic and am unable to find answer to this
question, Can anybody help?

*Question*: I am sending to topic "VirtualTopic.Test" and have a logical
Queue "Consumer.A.VirtualTopic.Test". I have a subscriber (A) to topic and a
consumer (B) to physical queue corresponding to logical queue
("Consumer.A.VirtualTopic.Test"), among them (A and B) who will receive
message first A or B?

Thanks,
Pradeep



--
View this message in context: http://activemq.2283324.n4.nabble.com/Who-will-receive-messages-first-virtual-topic-subscriber-or-logical-queue-consumer-tp4685974.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Who will receive messages first virtual topic subscriber or logical queue consumer?

Posted by Andreas Gies <an...@wayofquality.de>.
Hi again,

the ActiveMQ gods may correct me, but the acknowledgement mode has nothing
to do with how the messages are actually dispatched. As I said before - 
the easiest way
to grasp a Virtual topic is to to see it as a group of subscribers 
acting as one.

Technically there is a queue underneath, but the broker handles that for 
you. You could also
say that Virtual topics are a "Topic to Queue" bridge.

If you are asking how guaranteed delivery works:

For subscribers that are in fact real topic subscribers: those need to 
be durable and you need
to send the messages persistently.

If you wanted to make a subscriber group "durable" you must
make sure the underlying queue exists by defining it in your broker 
configuration. Otherwise
the group (and therefore the consumer) will only exist if at least one 
group member is connected.


If you do this, you can work with normal acknowledgement operations.

Best regards
Andreas



On 29/09/14 14:32, bansalp wrote:
> Thanks Andreas
>
> So normal acknowledgement that works with persistent messages in case of
> topics with durable subscriber will not be there in case of virtual topic.
> Or will it be there and have some other behavior?
>
> Any idea on this ?
>
> Thanks,
> Pradeep
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Who-will-receive-messages-first-virtual-topic-subscriber-or-logical-queue-consumer-tp4685974p4685977.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

-- 


    Andreas Gies

WoQ -- Way of Quality GmbH

Geschäftsführer & CTO

/eMail:/andreas@wayofquality.de <ma...@wayofquality.de>

/Tel:/ +49 151 23470823

/Fax:/ +49 1805 006534 2114

/Twitter:/ andreasgies /Skype:/ giessonic

/LinkedIn:/ <http://de.linkedin.com/pub/andreas-gies/0/594/aa5/> 
(http://de.linkedin.com/pub/andreas-gies/0/594/aa5/)

/Xing:/ <http://www.xing.com/profile/Andreas_Gies> 
(http://www.xing.com/profile/Andreas_Gies)

/Blog:/ <http://www.wayofquality.de/index.php/en/blog> 
(http://www.wayofquality.de/index.php/en/blog)

/Github:/ <https://github.com/atooni> (https://github.com/atooni)

/Amtsgericht Landshut:/HRB 8352//

//

/Ust.-Id.:/ DE274771254


      Haftungsausschluss

Diese Email kann vertrauliche und/oder rechtlich geschützte 
Informationen enthalten und ist ausschließlich für den/die benannten 
Adressaten bestimmt. Sollten Sie nicht der beabsichtigte Empfänger sein 
oder diese Email irrtümlich erhalten haben, ist es Ihnen nicht gestattet 
diese Mail oder einen Teil davon ohne unsere Erlaubnis zu verbreiten, zu 
kopieren, unbefugt weiterzuleiten oder zu behalten. Informieren Sie 
bitte sofort den Absender telefonisch oder per Email und löschen Sie 
diese Email und alle Kopien aus Ihrem System. Wir haften nicht für die 
Unversehrtheit von Emails, nachdem sie unseren Einflussbereich verlassen 
haben.


      Disclaimer

This email may contain confidential and/or privileged information and is 
intended solely for the attention and use of the named addressee(s). If 
you are not the intended recipient, or a person responsible for 
delivering it to the intended recipient, you are not authorized to and 
must not disclose, copy, distribute, or retain this message or any part 
of it without our authority. Please contact the sender by call or reply 
email immediately and destroy all copies and the original message. We 
are not responsible for the integrity of emails after they have left our 
sphere of control.

//

Re: Who will receive messages first virtual topic subscriber or logical queue consumer?

Posted by bansalp <bp...@gmail.com>.
Thanks Andreas

So normal acknowledgement that works with persistent messages in case of
topics with durable subscriber will not be there in case of virtual topic.
Or will it be there and have some other behavior?

Any idea on this ?

Thanks,
Pradeep



--
View this message in context: http://activemq.2283324.n4.nabble.com/Who-will-receive-messages-first-virtual-topic-subscriber-or-logical-queue-consumer-tp4685974p4685977.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Who will receive messages first virtual topic subscriber or logical queue consumer?

Posted by Andreas Gies <an...@wayofquality.de>.
Hi

I would dare to say thats fairly unpredictable.

If you are relying on the order in which multiple recipients of a topic 
recieve a particular message,
then you should reconsider your appliaction design with respect to the 
message flow.

In a nutshell, you can consider each virtual destination as a subscriber 
group. Upon Sending a
message into a topic each subscriber AND each subscriber group will 
consume an instance of
that message. Within each group you should not try to predict which 
group member should
receive the message and across groups and normal subscribers you 
shouldn't try to predict
the order in which the messages are dispatched to those.

This having said - if you combine virtual destinations with message 
groups you can make
a group of messages stick to one group member. Again - the first message 
of a group will
be consumed by a random member and the other messages of the group will 
follow.
If you are using groups, don't forget to terminate message groups, 
otherwise you might lose
the load balancing effect of a subscriber group.




My 2 ct
Andreas

On 29/09/14 13:36, bansalp wrote:
> Hi,
>
> I am trying to use virtual topic and am unable to find answer to this
> question, Can anybody help?
>
> *Question*: I am sending to topic "VirtualTopic.Test" and have a logical
> Queue "Consumer.A.VirtualTopic.Test". I have a subscriber (A) to topic and a
> consumer (B) to physical queue corresponding to logical queue
> ("Consumer.A.VirtualTopic.Test"), among them (A and B) who will receive
> message first A or B?
>
> Thanks,
> Pradeep
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Who-will-receive-messages-first-virtual-topic-subscriber-or-logical-queue-consumer-tp4685974.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

-- 


    Andreas Gies

WoQ -- Way of Quality GmbH

Geschäftsführer & CTO

/eMail:/andreas@wayofquality.de <ma...@wayofquality.de>

/Tel:/ +49 151 23470823

/Fax:/ +49 1805 006534 2114

/Twitter:/ andreasgies /Skype:/ giessonic

/LinkedIn:/ <http://de.linkedin.com/pub/andreas-gies/0/594/aa5/> 
(http://de.linkedin.com/pub/andreas-gies/0/594/aa5/)

/Xing:/ <http://www.xing.com/profile/Andreas_Gies> 
(http://www.xing.com/profile/Andreas_Gies)

/Blog:/ <http://www.wayofquality.de/index.php/en/blog> 
(http://www.wayofquality.de/index.php/en/blog)

/Github:/ <https://github.com/atooni> (https://github.com/atooni)

/Amtsgericht Landshut:/HRB 8352//

//

/Ust.-Id.:/ DE274771254


      Haftungsausschluss

Diese Email kann vertrauliche und/oder rechtlich geschützte 
Informationen enthalten und ist ausschließlich für den/die benannten 
Adressaten bestimmt. Sollten Sie nicht der beabsichtigte Empfänger sein 
oder diese Email irrtümlich erhalten haben, ist es Ihnen nicht gestattet 
diese Mail oder einen Teil davon ohne unsere Erlaubnis zu verbreiten, zu 
kopieren, unbefugt weiterzuleiten oder zu behalten. Informieren Sie 
bitte sofort den Absender telefonisch oder per Email und löschen Sie 
diese Email und alle Kopien aus Ihrem System. Wir haften nicht für die 
Unversehrtheit von Emails, nachdem sie unseren Einflussbereich verlassen 
haben.


      Disclaimer

This email may contain confidential and/or privileged information and is 
intended solely for the attention and use of the named addressee(s). If 
you are not the intended recipient, or a person responsible for 
delivering it to the intended recipient, you are not authorized to and 
must not disclose, copy, distribute, or retain this message or any part 
of it without our authority. Please contact the sender by call or reply 
email immediately and destroy all copies and the original message. We 
are not responsible for the integrity of emails after they have left our 
sphere of control.

//