You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by kidfruit <ki...@gmail.com> on 2014/07/21 17:58:05 UTC

ONLY one side can receive message!

My activemq is 5.10, nms is 1.6

I create two topic consumers in two different pc for the same tune such as
"topic://foo.bar", then send a map message from one pc.

If B send , A and B can receive message. no problem.
If A send , A can receive message, B can't receive. But I check web
management, I can find that in this topic, the consumer B's enqueued has
creased 1,but dequeued is always 0. Consumer A's enqueued is 1 and dequeued
is 1, that's ok. I don't know what's wrong with this.

Then I change some computers, always one can receive but another can't, and
can not sure which receive. Maybe when A&B, A can receive B can't, but when
A&C, A can't C can.

Is my operation incorrect or there are some bugs?



--
View this message in context: http://activemq.2283324.n4.nabble.com/ONLY-one-side-can-receive-message-tp4683485.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ONLY one side can receive message!

Posted by kidfruit <ki...@gmail.com>.
Thanks! The time not in sync is worth trying. I will test it tomorrow.



--
View this message in context: http://activemq.2283324.n4.nabble.com/ONLY-one-side-can-receive-message-tp4683485p4683534.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ONLY one side can receive message!

Posted by kidfruit <ki...@gmail.com>.
Solved!

The reason is that my computers' time are not sync.

You point the key!


Thank you!



--
View this message in context: http://activemq.2283324.n4.nabble.com/ONLY-one-side-can-receive-message-tp4683485p4683551.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ONLY one side can receive message!

Posted by Timothy Bish <ta...@gmail.com>.
On 07/22/2014 10:47 AM, kidfruit wrote:
> tabish121@gmail.com wrote
>> On 07/21/2014 11:58 AM, kidfruit wrote:
>>> My activemq is 5.10, nms is 1.6
>>>
>>> I create two topic consumers in two different pc for the same tune such
>>> as
>>> "topic://foo.bar", then send a map message from one pc.
>>>
>>> If B send , A and B can receive message. no problem.
>>> If A send , A can receive message, B can't receive. But I check web
>>> management, I can find that in this topic, the consumer B's enqueued has
>>> creased 1,but dequeued is always 0. Consumer A's enqueued is 1 and
>>> dequeued
>>> is 1, that's ok. I don't know what's wrong with this.
>>>
>>> Then I change some computers, always one can receive but another can't,
>>> and
>>> can not sure which receive. Maybe when A&B, A can receive B can't, but
>>> when
>>> A&C, A can't C can.
>>>
>>> Is my operation incorrect or there are some bugs?
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://activemq.2283324.n4.nabble.com/ONLY-one-side-can-receive-message-tp4683485.html
>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>
>> Remember for topics that the consumer must be subscribed and running
>> before the message is sent, Topics do no persist messages unless the
>> subscription is durable and has subscribed at least once in order to
>> establish the durable subscription.
>>
>> -- 
>> Tim Bish
>> Sr Software Engineer | RedHat Inc.
>> tim.bish@redhat.com | www.fusesource.com | www.redhat.com
>> skype: tabish121 | twitter: @tabish121
>> blog: http://timbish.blogspot.com/
> Quoted from:
> http://activemq.2283324.n4.nabble.com/ONLY-one-side-can-receive-message-tp4683485p4683487.html
>
>
> Thank you for your answer.
> But I have tested by your method and can not help..
> Then I do a lot of tests and find that a code caused my problem.
> The C# code with NMS is like this:
>
> ===================================
> ITextMessage message=session.CreateTextMessage("test");
> message.NMSTimeToLive=TimeSpan.FromSeconds(5); //this line!
> producer.Send(message);
> ===================================
>
> If I define TimeToLive property, I will get the problem which I post at top.
> But if I comment this line, as I don't define the TimeToLive, everything
> will do as I want. I do know that this property means how long the message
> will live, but the problem is even if I open a durable consumer for
> listening, then open this producer and send, the web management can display
> enqueue=1, but dequeue=0, and consumer can't get this message. Then I
> restart consumer, and nothing happen too.
>      I am crazy about this......I can't define the life time?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ONLY-one-side-can-receive-message-tp4683485p4683529.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Five seconds is pretty short, make sure it's long enough for your client 
to get the message.  Also ensure that the clocks on the machines you are 
using are in sync otherwise a message can immediately expire depending 
on the difference between the clocks.

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/


Re: ONLY one side can receive message!

Posted by kidfruit <ki...@gmail.com>.
tabish121@gmail.com wrote
> On 07/21/2014 11:58 AM, kidfruit wrote:
>> My activemq is 5.10, nms is 1.6
>>
>> I create two topic consumers in two different pc for the same tune such
>> as
>> "topic://foo.bar", then send a map message from one pc.
>>
>> If B send , A and B can receive message. no problem.
>> If A send , A can receive message, B can't receive. But I check web
>> management, I can find that in this topic, the consumer B's enqueued has
>> creased 1,but dequeued is always 0. Consumer A's enqueued is 1 and
>> dequeued
>> is 1, that's ok. I don't know what's wrong with this.
>>
>> Then I change some computers, always one can receive but another can't,
>> and
>> can not sure which receive. Maybe when A&B, A can receive B can't, but
>> when
>> A&C, A can't C can.
>>
>> Is my operation incorrect or there are some bugs?
>>
>>
>>
>> --
>> View this message in context:
>> http://activemq.2283324.n4.nabble.com/ONLY-one-side-can-receive-message-tp4683485.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
> Remember for topics that the consumer must be subscribed and running 
> before the message is sent, Topics do no persist messages unless the 
> subscription is durable and has subscribed at least once in order to 
> establish the durable subscription.
> 
> -- 
> Tim Bish
> Sr Software Engineer | RedHat Inc.
> tim.bish@redhat.com | www.fusesource.com | www.redhat.com
> skype: tabish121 | twitter: @tabish121
> blog: http://timbish.blogspot.com/

Quoted from: 
http://activemq.2283324.n4.nabble.com/ONLY-one-side-can-receive-message-tp4683485p4683487.html


Thank you for your answer.
But I have tested by your method and can not help..
Then I do a lot of tests and find that a code caused my problem.
The C# code with NMS is like this:

===================================
ITextMessage message=session.CreateTextMessage("test");
message.NMSTimeToLive=TimeSpan.FromSeconds(5); //this line!
producer.Send(message);
===================================

If I define TimeToLive property, I will get the problem which I post at top.
But if I comment this line, as I don't define the TimeToLive, everything
will do as I want. I do know that this property means how long the message
will live, but the problem is even if I open a durable consumer for
listening, then open this producer and send, the web management can display
enqueue=1, but dequeue=0, and consumer can't get this message. Then I
restart consumer, and nothing happen too.
    I am crazy about this......I can't define the life time?



--
View this message in context: http://activemq.2283324.n4.nabble.com/ONLY-one-side-can-receive-message-tp4683485p4683529.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ONLY one side can receive message!

Posted by Timothy Bish <ta...@gmail.com>.
On 07/21/2014 11:58 AM, kidfruit wrote:
> My activemq is 5.10, nms is 1.6
>
> I create two topic consumers in two different pc for the same tune such as
> "topic://foo.bar", then send a map message from one pc.
>
> If B send , A and B can receive message. no problem.
> If A send , A can receive message, B can't receive. But I check web
> management, I can find that in this topic, the consumer B's enqueued has
> creased 1,but dequeued is always 0. Consumer A's enqueued is 1 and dequeued
> is 1, that's ok. I don't know what's wrong with this.
>
> Then I change some computers, always one can receive but another can't, and
> can not sure which receive. Maybe when A&B, A can receive B can't, but when
> A&C, A can't C can.
>
> Is my operation incorrect or there are some bugs?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ONLY-one-side-can-receive-message-tp4683485.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Remember for topics that the consumer must be subscribed and running 
before the message is sent, Topics do no persist messages unless the 
subscription is durable and has subscribed at least once in order to 
establish the durable subscription.

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/