-
1. Re: Cannot send a non JBoss message as a management message org.hornetq.ra.HornetQRAMessage
jimjohnson May 12, 2010 2:49 PM (in response to jimjohnson)Apparently I am really bad at wiki markup... sorry for the poor formatting.
-
2. Re: Cannot send a non JBoss message as a management message org.hornetq.ra.HornetQRAMessage
clebert.suconic May 12, 2010 3:07 PM (in response to jimjohnson)It seems you are mixing up classpath somehow.
-
3. Re: Cannot send a non JBoss message as a management message org.hornetq.ra.HornetQRAMessage
jimjohnson May 12, 2010 3:11 PM (in response to clebert.suconic)Certainly a possibility.. what makes you think that?
-
4. Re: Cannot send a non JBoss message as a management message org.hornetq.ra.HornetQRAMessage
jimjohnson May 12, 2010 3:15 PM (in response to jimjohnson)Also, for clarification. I hooked a debugger up. The "message" object is a HornetQMessage, it's the "reply" object that is a HornetQRAMessage. I don't know if that helps at all it just seems peculiar that when I do a session.createMessage I get the right type of message as opposed to a requestor.request return value.
-
5. Re: Cannot send a non JBoss message as a management message org.hornetq.ra.HornetQRAMessage
timfox May 12, 2010 3:25 PM (in response to jimjohnson)Looks like you're using the JCA managed connection factory which will create wrapped versions of the JMS objects
-
6. Re: Cannot send a non JBoss message as a management message org.hornetq.ra.HornetQRAMessage
jimjohnson May 12, 2010 3:42 PM (in response to timfox)Alright. My connectionfactory is simply injected via the following:
@Resource(mappedName = "java:/JmsXA")
QueueConnectionFactory connFactory;I assume you are saying I should use something like HornetQJMSClient.createConnectionFactory() instead? I just don't see anything in the documentation spelling this out but I could have missed it. -
7. Re: Cannot send a non JBoss message as a management message org.hornetq.ra.HornetQRAMessage
clebert.suconic May 12, 2010 4:06 PM (in response to jimjohnson)I'm not sure you could use management through a JCA connection ATM.
You could do it through a regular ConnectionFactory.
-
8. Re: Cannot send a non JBoss message as a management message org.hornetq.ra.HornetQRAMessage
jimjohnson May 12, 2010 4:17 PM (in response to clebert.suconic)Management calls appear to work fine. I did a 'createQueue' call just fine, as well as the operation to get the messageCount in my code above. It's just when I try to use isOperationSuccessful or getResult on JMSManagementHelper that I get this error. I'll try to get a "normal" connection factory as you put it and see if that helps.
-
9. Re: Cannot send a non JBoss message as a management message org.hornetq.ra.HornetQRAMessage
jimjohnson May 12, 2010 6:30 PM (in response to jimjohnson)Alright, I have now changed my ConnectionFactory. In the debugger I can see that the ConnectionFactory switched from a HornetQRAConnectionFactory to a HornetQConnectionFactory. That seems good. I continue along and in the code above and now when I make a call via requestor.request() the call never returns. I feel like I have to be missing something basic at this point but for the life of me I cannot figure out what's going on. Any ideas?
-
10. Re: Cannot send a non JBoss message as a management message org.hornetq.ra.HornetQRAMessage
clebert.suconic May 12, 2010 6:37 PM (in response to jimjohnson)starting the consumer?
share some code?
-
11. Re: Cannot send a non JBoss message as a management message org.hornetq.ra.HornetQRAMessage
clebert.suconic May 12, 2010 6:38 PM (in response to clebert.suconic)I see you started the connection on your initial post.
Double check in your code though.
-
12. Re: Cannot send a non JBoss message as a management message org.hornetq.ra.HornetQRAMessage
jimjohnson May 12, 2010 7:02 PM (in response to clebert.suconic)Alright this is all in a Service bean.
{code}
//Connection factory is injected @Resource(mappedName="java:/ConnectionFactory") QueueConnectionFactory connFactory; QueueConnection connection; QueueSession session; //in the start() method I do: connection = connFactory.createQueueConnection(); session = connection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE); connection.start();
{code}That all works finein another method, the one that is responsible for programatically deploying the queues I want, I do the following (queueID is passed into the method..):{code}
Queue managementQueue = HornetQJMSClient.createQueue(Constants.HORNETQ_MANAGEMENT_ADDRESS);QueueRequestor sender = new QueueRequestor(session, managementQueue);Message createQueueMessage = session.createMessage();JMSManagementHelper.putOperationInvocation(createQueueMessage, Constants.JMS_MANAGEMENT_ADDRESS, "createQueue", queueID,"queue/" + queueID);//This is the call that no longer returns. It does appear that the queue gets created though//as I am able to see it using twiddle and querying for org.hornetq:*sender.request(createQueueMessage);//After this call is the code I pasted in my orignal post:Message messageCountMessage = session.createMessage();JMSManagementHelper.putAttribute(messageCountMessage, "jms.queue." + queueID, "messageCount");Message reply = sender.request(messageCountMessage);int count = (Integer)JMSManagementHelper.getResult(reply);{code}When I switch my ConnectionFactory to be the "JmsXA" one, the first management call to create the queue returns fine, and the queue is created.The 2nd management call returns fine. I assume it has the correct result, however when I use JMSManagementHelper.getReuslt(reply), that's when I get the exception in my original post. Since switching my ConnectionFactory over to be the non JmsXA one, I now never see execution return from the first sender.request() call.Now all that said, for kicks I just swapped my "QueueRequestor" out with a "QueueSender" and did a .send instead of the first call, that returned 100% fine and returned immediately. I didn't try the 2nd chunk of code yet as I need to manually wire up the temporary reply queue first. So at this point I don't know if the problem is that QueueRequestor is somehow busted or if I am doing something incredibly dumb and missing a step somewhere. I'm going to continue down the path of using a QueueSender/QueueReciever and I'll wire up a temporary reply queue programatically instead and see if that works at least.Thanks for your help thusfar!*edit* sorry for all the edits if you were trying to read this. Been fighting w/ the markup so this is readable... -
13. Re: Cannot send a non JBoss message as a management message org.hornetq.ra.HornetQRAMessage
jimjohnson May 12, 2010 7:02 PM (in response to jimjohnson)I win this round WIKI MARKUP!
-
14. Re: Cannot send a non JBoss message as a management message org.hornetq.ra.HornetQRAMessage
jimjohnson May 13, 2010 11:57 AM (in response to jimjohnson)Back at it again today.
I have definitely narrowed down my issue to being getting replies from calls to the management queue. I have tried QueueReciever, MessageConsumer, and of course the QueueRequestor originally posted. No matter what I do, calls to recieve() w/o any timeout specified never seem to return. I have used QueueRequestor to wrap all the temporary queue work up for me, and I have set up a temporary queue manually using session.createTemporaryQueue and setting it as the jmsReplyTo on my message. Either way, when I do my send, and then try to wait for a response to my temporary queue, it never comes back. My send's appear to work fine, it's just waiting for a response that never happens. Now, I can of course set a timeout on my recieve() calls so I'm not in a state of constant waiting, but obviously when it times out I'm not going to have the reply to my message that I need...
My connection is 'started', there is no start I should need on any producer or consumer from that point on. I am really stumped as to what I am missing here. Hopefully someone will have any idea of another avenue I can attack.
Just to recap.
If I use "java:/JmsXA" as my connection factory binding, I get wrapped Message objects that cannot be used in the JMSManagementHelper. However, using that connection factory causes everything else to work just fine with regard to sends/receives. When I switch to use the connection factory bound to "java:/ConnectionFactory" instead, I can still send messages I just cannot seem to receive replies to those messages using standard temporary queue methodology.