You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Markus Joschko <ma...@gmail.com> on 2006/08/29 18:20:29 UTC

Messages send via JMX are deliverd, but the other ones not...

Hi,
I think I made a stupid mistake but I can't find it. I simply try to send
and receive a message from a topic. The problem is that if I try to send a
message from the code, it is never delivered to the clients (which are using
MessageAvailableListeners and operate on one connection). However I can see
in the JMX console, that there are two subscriptions on the topic "test".
Furthermore I see the attribute enqueuecount on the test topic increasing
when I send a message from the java code. On the Operations tab of the test
topic I can press the browseAsTable button I can see a number of JMS
messages which match the one I sent (at least the priority and the
timestamp). However fields like JMSType and properties are empty???

Doing a further test in the JMX console by sending a textmessage from it
triggers the clients. The messages are received correctly.
Hm, I have no clue what's going wrong. The code that sends the message:

            Destination destination = session.createTopic(channel);
            TextMessage message = this.session.createTextMessage(text);
            MessageProducer producer = this.session.createProducer(null);
           
            producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
            producer.setDisableMessageID(false);
            producer.setPriority(1);
            producer.send(destination, message);
            producer.close();

I wonder if it is correct to create the topic again to send a message.
However if I store the destination and reuse it, it doesn't work either.

Another thing that I can see in the JMX console and that makes me wonder is
that there are multiple topics:

test 
ActiveMQ.Advisory.Consumer.Topic.test

as soon as I send a message via the JMX console a further topic is created

ActiveMQ.Advisory.Producer.Topic.test

This does not happen if I try to send the message from the java code. Seems
that I don't understand how to correctly create a topic for a
messageproducer .....

Thanks for reading, 
 Markus

-- 
View this message in context: http://www.nabble.com/Messages-send-via-JMX-are-deliverd%2C-but-the-other-ones-not...-tf2184583.html#a6042456
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Messages send via JMX are deliverd, but the other ones not...

Posted by Markus Joschko <ma...@gmail.com>.
Sorry guys for wasting your time. I found the error. I had the noLocal flag
enabled on the consumer and didn't know that it's connection specific.
That's the reason why both testclients which share the same connection can't
receive a message. I openend up another JVM and everything worked fine.

Regards,
 Markus
-- 
View this message in context: http://www.nabble.com/Messages-send-via-JMX-are-deliverd%2C-but-the-other-ones-not...-tf2184583.html#a6043148
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Messages send via JMX are deliverd, but the other ones not...

Posted by Adrian Co <ac...@exist.com>.
Hi,

Could you attach your client code, so we could test it and see? 
(producer and consumer) :)


Markus Joschko wrote:
> Hi,
> I think I made a stupid mistake but I can't find it. I simply try to send
> and receive a message from a topic. The problem is that if I try to send a
> message from the code, it is never delivered to the clients (which are using
> MessageAvailableListeners and operate on one connection). However I can see
> in the JMX console, that there are two subscriptions on the topic "test".
> Furthermore I see the attribute enqueuecount on the test topic increasing
> when I send a message from the java code. On the Operations tab of the test
> topic I can press the browseAsTable button I can see a number of JMS
> messages which match the one I sent (at least the priority and the
> timestamp). However fields like JMSType and properties are empty???
>
> Doing a further test in the JMX console by sending a textmessage from it
> triggers the clients. The messages are received correctly.
> Hm, I have no clue what's going wrong. The code that sends the message:
>
>             Destination destination = session.createTopic(channel);
>             TextMessage message = this.session.createTextMessage(text);
>             MessageProducer producer = this.session.createProducer(null);
>            
>             producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
>             producer.setDisableMessageID(false);
>             producer.setPriority(1);
>             producer.send(destination, message);
>             producer.close();
>
> I wonder if it is correct to create the topic again to send a message.
> However if I store the destination and reuse it, it doesn't work either.
>
> Another thing that I can see in the JMX console and that makes me wonder is
> that there are multiple topics:
>
> test 
> ActiveMQ.Advisory.Consumer.Topic.test
>
> as soon as I send a message via the JMX console a further topic is created
>
> ActiveMQ.Advisory.Producer.Topic.test
>
> This does not happen if I try to send the message from the java code. Seems
> that I don't understand how to correctly create a topic for a
> messageproducer .....
>
> Thanks for reading, 
>  Markus
>
>