-
1. Re: Keeping connection alive by pinging the server
clebert.suconic Jun 17, 2011 12:30 AM (in response to rahul_516)You should probably try a smaller timeout.
Or you could use management to kill the client.
We can't let you reconnect to the same session through JMS as JMS doesn't let you have two connections with the same IDs (I assume you are using topics hence you need that).
If you were using core-api, you would just be able to connect to the same core-queue without any issues.
-
2. Re: Keeping connection alive by pinging the server
rahul_516 Jun 17, 2011 1:42 AM (in response to clebert.suconic)Thank you for your valuable inputs.
If i have a JMS topic like below in hornetq-jms.xml
<topic name="BillableAggregatedEvents"> <entry name="/topic/BillableAggregatedEvents"/> </topic> Does this topic gets converted to core queue. of the type "jms.topic.BillableAggregatedEvents" ?
The reason iam asking this is primarily on the consumer side we want to use Hornetq core , and on the producer side we have JMS producer.
Which sends message on the JMS topic.
So is it possible that a queue which is populated by the JMS producer is being consumed by Hornetq consumer ?
-
3. Re: Keeping connection alive by pinging the server
rahul_516 Jun 17, 2011 6:55 AM (in response to rahul_516)I have create a JMS Topic of the form
<topic name="BillableAggregatedEvents"> <entry name="/topic/BillableAggregatedEvents"/> </topic> In JConsole i can see that under Queue=>Core=> a queue is formed by the name "jms.topic.BillableAggregatedEvents".
I created a ClientConsuer to connect to this queue , but though it connects but when JMSProducer is sending message to the topic, HornetqClient ClientConsumer is not recieving anything.
Does this means, that If JMSProducer publishes on a topic , ClientConsumer cant consume those messages?
It means eithere both Producer and COnsumer should be either ClientProducer and ClientConsumer or both should be JMSProducer and JMSconsumer ?
Any help is deeply appreciated.
-
4. Re: Keeping connection alive by pinging the server
clebert.suconic Jun 17, 2011 12:36 PM (in response to rahul_516)Yes, the subscription will be a core-queue. I can't remember the rule to compose the name now. You can probably find it easily on the JMX console. Let me know if you can't find it then I will figure out.
-
5. Re: Keeping connection alive by pinging the server
rahul_516 Jun 19, 2011 9:26 PM (in response to clebert.suconic)Iam not able to figure out for which part you have said Yes.
I have 2 questions primarily.
1 . If JMSProducer publishes on a topic(Producer side implementation is JMS based ) , Can ClientConsumer consume those messages , using the queue name?Because from JMX console i can see that all the JMS topics get converted to queuenames.
2 . If 1 is false , It means either both Producer and COnsumer should be either ClientProducer and ClientConsumer or both should be JMSProducer and JMSconsumer ?
-
6. Re: Keeping connection alive by pinging the server
rahul_516 Jun 19, 2011 10:15 PM (in response to rahul_516)I looked at the JMX console.
MBeanInfo for this core queue is : org.hornetq:module=Core,type=Queue,address="jms.topic.BillableAggregatedEvents",name="jms.topic.BillableAggregatedEvents"
Iam using the core queue name as "jms.topic.BillableAggregatedEvents" (without double quotes) for the subcription , But when ClientConsumer is listening to this particular topic , we dont get any messages.
Remember Producer is sending jms's MapMessages , On the consumer side we are recieveing ClientMessage and trying to use getStringProperty method to retrieve the object.
The above scenario is not working at all
-
7. Re: Keeping connection alive by pinging the server
clebert.suconic Jun 20, 2011 12:48 AM (in response to rahul_516)BTW: if you just want to use core-api on receiving a subscriber, you don't need to follow any standards to define the queue name.
the only thing you need is to create a Queue on the Address for the topic. That way:
createQueue("jms.topic.TopicName", "my-queue_name");
That way any message sent to the topic will be received on my-queue_name.
When you consume, you have to do createconsumer("my-queue_name");
Anyway, the name of the queue for a durable subscription is seen at HornetQDestination.
createQueueNameForDurableSubscription(final String clientID, final String subscriptionName)
-
8. Re: Keeping connection alive by pinging the server
rahul_516 Jun 20, 2011 2:28 AM (in response to clebert.suconic)What about the messages . The Producer is sending the MapMessages but on the consumer side we are accepting the ClientMessages.
Is there a conversion which is possible?
thank you for ur inputs.