You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by alainkr <ak...@gmail.com> on 2018/03/14 16:19:45 UTC

VirtualTopic and VirtualTopic Consumer

Hello

It look's like that messages sent to VirtualTopic are only forwarded to
Consumer when they are actively listening. 

Is there a way to have this forwarding regardless of the consumer actually
listening or not, but just by the fact the the queues exist ? 

Thanks

Alain




--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: VirtualTopic and VirtualTopic Consumer

Posted by Tim Bain <tb...@alumni.duke.edu>.
I read that option, but it never clicked for me that that might be the root
cause. I'm glad you figured it out. Thanks for reporting back here so
someone else reading this thread in the future will know to check that as a
possible explanation.

Tim

On Tue, Mar 20, 2018, 3:07 PM alainkr <ak...@gmail.com> wrote:

> Tim thanks alot for your answer.
>
> Sorry for not checking in earlier, the issue I was having ( with 5.14.5) is
> that I stumbled upon the following problem.
>
>
> We used selectorAware=true but did not use the
> virtualSelectorCacheBrokerPlugin  ( as in
>
> https://github.com/apache/activemq/blob/master/activemq-unit-tests/src/test/resources/org/apache/activemq/broker/virtual/disconnected-selector.xml
> <
> https://github.com/apache/activemq/blob/master/activemq-unit-tests/src/test/resources/org/apache/activemq/broker/virtual/disconnected-selector.xml
> >
> )
>
> So offline consumer where not getting messages forwarded (while offline)
> We choose not to use selector for the time being. So we're getting the
> excepted behavior.
>
> Thanks again.
>
> Alain
>
>
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>

Re: VirtualTopic and VirtualTopic Consumer

Posted by alainkr <ak...@gmail.com>.
Tim thanks alot for your answer.

Sorry for not checking in earlier, the issue I was having ( with 5.14.5) is
that I stumbled upon the following problem.


We used selectorAware=true but did not use the
virtualSelectorCacheBrokerPlugin  ( as in 
https://github.com/apache/activemq/blob/master/activemq-unit-tests/src/test/resources/org/apache/activemq/broker/virtual/disconnected-selector.xml
<https://github.com/apache/activemq/blob/master/activemq-unit-tests/src/test/resources/org/apache/activemq/broker/virtual/disconnected-selector.xml>  
)

So offline consumer where not getting messages forwarded (while offline) 
We choose not to use selector for the time being. So we're getting the
excepted behavior.

Thanks again.

Alain 





--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: VirtualTopic and VirtualTopic Consumer

Posted by Tim Bain <tb...@alumni.duke.edu>.
I looked again at your original message, and realized that another
(simpler, and therefore probably more likely) interpretation of what you
wrote is that you're only seeing messages sent to topic VirtualTopic.Test
appearing in queue Consumer.A.VirtualTopic.Test when the consumer is
connected. So I'll assume for now that I misinterpreted your question when
I first reply, and respond based on this simpler interpretation here.

I set up a pair of simple unit tests where the first sends a message to
VirtualTopic.Test and the second attempts to receive a message from
Consumer.A.VirtualTopic.Test. If I run the producer test and then the
consumer test, I receive a message in the consumer test, which proves that
this feature works (for 5.14.5, the broker version I'm testing with; you
didn't say what version you're using, so I can't say whether it's the same
version you're using). So if the simpler interpretation of your question is
right, the behavior you're seeing is not because the broker doesn't work
properly for this feature.

Are you sure that no message is getting enqueued in the queue when a
message is sent to the topic and the consumer is offline? To confirm that,
do the following:

   - Ensure that your consumer has attempted to consume from
   Consumer.YOURCONSUMERNAME.VirtualTopic.YOURTOPICNAME, and then
   disconnect the consumer
   - Attach a JMX viewer such as JConsole to the broker
   - Navigate to the Consumer.YOURCONSUMERNAME.VirtualTopic.YOURTOPICNAME
   MBean, then view it's attributes
   - Note the EnqueueCount value
   - Ensure that your consumer is disconnected
   - Have your producer publish one and only one message to topic
   VirtualTopic.YOURTOPICNAME
   - Refresh the attributes of the
Consumer.YOURCONSUMERNAME.VirtualTopic.YOURTOPICNAME
   MBean
   - Note the EnqueueCount value

If the value increased by 1, then the broker is functioning properly, and
your inability to consume messages from the queue isn't because the virtual
topic isn't working properly. (Maybe the message is expiring before being
consumed?)

If the value didn't increase, then the behavior you're seeing doesn't match
what I'm seeing, and we'll have to dig into it further.

Tim

On Fri, Mar 16, 2018 at 7:04 AM, Tim Bain <tb...@alumni.duke.edu> wrote:

> Are you talking about forwarding between brokers in a network of brokers?
> In that case, you would want to use staticallyIncludedDestinations instead
> of dynamicallyIncludedDestinations.
>
> Tim
>
> On Wed, Mar 14, 2018, 10:19 AM alainkr <ak...@gmail.com> wrote:
>
>> Hello
>>
>> It look's like that messages sent to VirtualTopic are only forwarded to
>> Consumer when they are actively listening.
>>
>> Is there a way to have this forwarding regardless of the consumer actually
>> listening or not, but just by the fact the the queues exist ?
>>
>> Thanks
>>
>> Alain
>>
>>
>>
>>
>> --
>> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805
>> .html
>>
>

Re: VirtualTopic and VirtualTopic Consumer

Posted by Tim Bain <tb...@alumni.duke.edu>.
Are you talking about forwarding between brokers in a network of brokers?
In that case, you would want to use staticallyIncludedDestinations instead
of dynamicallyIncludedDestinations.

Tim

On Wed, Mar 14, 2018, 10:19 AM alainkr <ak...@gmail.com> wrote:

> Hello
>
> It look's like that messages sent to VirtualTopic are only forwarded to
> Consumer when they are actively listening.
>
> Is there a way to have this forwarding regardless of the consumer actually
> listening or not, but just by the fact the the queues exist ?
>
> Thanks
>
> Alain
>
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>