You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by hcy <hr...@industrialdefender.com> on 2015/08/18 22:28:39 UTC

Reading HornetQ messages using Proton and Messaging API (.net)

I have downloaded and built qpid-proton-0.10.tar.gz and Qpid Messaging API.

The goal is to read messages from HornetQ on a Windows environment.

I am trying to run csharp.example.drain project, I was able to open the
connection and create a session. However, I was never able to read a message
- the console application hang for a while and terminates with the error
"Disconnected (reconnect disabled)".

Further investigation on HornetQ log, I found the following exceptions and
it was actually triggered by the call *Receiver receiver =
session.CreateReceiver(options.Address)*. Can anyone help?

2015-08-18 16:23:33,156 [Thread-86
(HornetQ-server-HornetQServerImpl::serverUUID=eca59c4c-45bd-11e5-89b0-57e46941877b-1556893158)]
WARN  org.hornetq.core.server - HQ222151: removing consumer which did not
handle a message, .......
java.lang.NumberFormatException: null
	at java.lang.Long.parseLong(Unknown Source) ~[na:1.8.0_51]
	at java.lang.Long.valueOf(Unknown Source) ~[na:1.8.0_51]
	at
org.hornetq.utils.TypedProperties.getLongProperty(TypedProperties.java:307)
~[hornetq-commons-2.4.5.Final.jar:na]
	at
org.hornetq.core.message.impl.MessageImpl.getLongProperty(MessageImpl.java:804)
~[hornetq-core-client-2.4.5.Final.jar:na]
	at
org.hornetq.core.protocol.proton.ProtonUtils$OUTBOUND.transform(ProtonUtils.java:339)
~[hornetq-amqp-protocol-2.4.5.Final.jar:na]
	at
org.hornetq.core.protocol.proton.ProtonConsumer.handleDelivery(ProtonConsumer.java:203)
~[hornetq-amqp-protocol-2.4.5.Final.jar:na]
	at
org.hornetq.core.protocol.proton.ProtonSession.sendMessage(ProtonSession.java:131)
~[hornetq-amqp-protocol-2.4.5.Final.jar:na]
	at
org.hornetq.core.server.impl.ServerConsumerImpl.deliverStandardMessage(ServerConsumerImpl.java:949)
~[hornetq-server-2.4.5.Final.jar:na]
	at
org.hornetq.core.server.impl.ServerConsumerImpl.proceedDeliver(ServerConsumerImpl.java:398)
~[hornetq-server-2.4.5.Final.jar:na]
	at
org.hornetq.core.server.impl.QueueImpl.proceedDeliver(QueueImpl.java:2544)
~[hornetq-server-2.4.5.Final.jar:na]
	at org.hornetq.core.server.impl.QueueImpl.deliver(QueueImpl.java:2137)
~[hornetq-server-2.4.5.Final.jar:na]
	at org.hornetq.core.server.impl.QueueImpl.access$1300(QueueImpl.java:81)
~[hornetq-server-2.4.5.Final.jar:na]
	at
org.hornetq.core.server.impl.QueueImpl$DeliverRunner.run(QueueImpl.java:2917)
~[hornetq-server-2.4.5.Final.jar:na]
	at
org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:104)
[hornetq-core-client-2.4.5.Final.jar:na]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[na:1.8.0_51]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[na:1.8.0_51]
	at java.lang.Thread.run(Unknown Source) [na:1.8.0_51]



--
View this message in context: http://qpid.2158936.n2.nabble.com/Reading-HornetQ-messages-using-Proton-and-Messaging-API-net-tp7629726.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Reading HornetQ messages using Proton and Messaging API (.net)

Posted by Robbie Gemmell <ro...@gmail.com>.
On 19 August 2015 at 16:16, Gordon Sim <gs...@redhat.com> wrote:
> On 08/19/2015 04:08 PM, hcy wrote:
>>
>> More info on this:
>>
>> I was able to successfully run csharp.example.helloworld using an existing
>> queue. Meaning I was able to read the message that was sent using the
>> example code.
>>
>> I am unable to read a message which was sent using Spring JMS integration.
>
>
> This, along with your previous tracing of the exception to the fact that the
> message property "HORNETQ_PROTON_MESSAGE_FORMAT" was not set, suggests to me
> that the version of hornetq you are using doesn't convert messages sent in
> another protocol into an AMQP format.
>

I think Gordon hit the nail on the head.

> You could perhaps try with ActiveMQ Artemis, which is based on the hornetq
> codebase and has perhaps seen improvements in that area(?)
>

I can't say I have tried this with Artemis, but I do know the AMQP
support did changed a lot between the 2.4.5 that looks to have been
used here and what became Artermis 1.0.0 following the donation of the
codebase. A 1.1.0 release is due soon as well, based on discussion on
the ActiveMQ mailing lists.

Robbie

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Reading HornetQ messages using Proton and Messaging API (.net)

Posted by Gordon Sim <gs...@redhat.com>.
On 08/19/2015 04:08 PM, hcy wrote:
> More info on this:
>
> I was able to successfully run csharp.example.helloworld using an existing
> queue. Meaning I was able to read the message that was sent using the
> example code.
>
> I am unable to read a message which was sent using Spring JMS integration.

This, along with your previous tracing of the exception to the fact that 
the message property "HORNETQ_PROTON_MESSAGE_FORMAT" was not set, 
suggests to me that the version of hornetq you are using doesn't convert 
messages sent in another protocol into an AMQP format.

You could perhaps try with ActiveMQ Artemis, which is based on the 
hornetq codebase and has perhaps seen improvements in that area(?)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Reading HornetQ messages using Proton and Messaging API (.net)

Posted by hcy <hr...@industrialdefender.com>.
More info on this:

I was able to successfully run csharp.example.helloworld using an existing
queue. Meaning I was able to read the message that was sent using the
example code.

I am unable to read a message which was sent using Spring JMS integration. 



--
View this message in context: http://qpid.2158936.n2.nabble.com/Reading-HornetQ-messages-using-Proton-and-Messaging-API-net-tp7629726p7629760.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Reading HornetQ messages using Proton and Messaging API (.net)

Posted by hcy <hr...@industrialdefender.com>.
I set the log level and log destination like so

>set QPID_LOG_ENABLE=trace+
>set QPID_LOG_TO_FILE=c:\temp\qpid.log

I ran the example again

>csharp.example.drain jms.queue.XXXXXXXQueue

Note, the queue XXXXXXXQueue was created and written to elsewhere, using
Spring JMS integration. I got the following error and nothing in the
qpid.log

Exception Org.Apache.Qpid.Messaging.QpidException: Disconnected (reconnect
disabled)
   at Org.Apache.Qpid.Messaging.Receiver.Fetch(Message& mmsgp, Duration
duration) in c:\qpid\cpp\bindings\qpid\dotnet\src\receiver.cpp:line 290
   at Org.Apache.Qpid.Messaging.Examples.Drain.Main(String[] args) in
c:\qpid\cpp\bindings\qpid\dotnet\examples\csharp.example.drain\csharp.example.drain.cs:line
49.

Same error as before appears in the HornetQ server log:
java.lang.NumberFormatException.

I traced the code (ProtonUtils.java) and it appears that message property
"HORNETQ_PROTON_MESSAGE_FORMAT" was not set. Could this be a problem?



--
View this message in context: http://qpid.2158936.n2.nabble.com/Reading-HornetQ-messages-using-Proton-and-Messaging-API-net-tp7629726p7629758.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Reading HornetQ messages using Proton and Messaging API (.net)

Posted by Chuck Rolke <cr...@redhat.com>.
A Qpid Messaging may be revealing. Try:

  > SET QPID_LOG_ENABLE=trace+
  > csharp.example.drain ...

What command line args do you use for drain?


----- Original Message -----
> From: "hcy" <hr...@industrialdefender.com>
> To: users@qpid.apache.org
> Sent: Tuesday, August 18, 2015 4:28:39 PM
> Subject: Reading HornetQ messages using Proton and Messaging API (.net)
> 
> I have downloaded and built qpid-proton-0.10.tar.gz and Qpid Messaging API.
> 
> The goal is to read messages from HornetQ on a Windows environment.
> 
> I am trying to run csharp.example.drain project, I was able to open the
> connection and create a session. However, I was never able to read a message
> - the console application hang for a while and terminates with the error
> "Disconnected (reconnect disabled)".
> 
> Further investigation on HornetQ log, I found the following exceptions and
> it was actually triggered by the call *Receiver receiver =
> session.CreateReceiver(options.Address)*. Can anyone help?
> 
> 2015-08-18 16:23:33,156 [Thread-86
> (HornetQ-server-HornetQServerImpl::serverUUID=eca59c4c-45bd-11e5-89b0-57e46941877b-1556893158)]
> WARN  org.hornetq.core.server - HQ222151: removing consumer which did not
> handle a message, .......
> java.lang.NumberFormatException: null
> 	at java.lang.Long.parseLong(Unknown Source) ~[na:1.8.0_51]
> 	at java.lang.Long.valueOf(Unknown Source) ~[na:1.8.0_51]
> 	at
> org.hornetq.utils.TypedProperties.getLongProperty(TypedProperties.java:307)
> ~[hornetq-commons-2.4.5.Final.jar:na]
> 	at
> org.hornetq.core.message.impl.MessageImpl.getLongProperty(MessageImpl.java:804)
> ~[hornetq-core-client-2.4.5.Final.jar:na]
> 	at
> org.hornetq.core.protocol.proton.ProtonUtils$OUTBOUND.transform(ProtonUtils.java:339)
> ~[hornetq-amqp-protocol-2.4.5.Final.jar:na]
> 	at
> org.hornetq.core.protocol.proton.ProtonConsumer.handleDelivery(ProtonConsumer.java:203)
> ~[hornetq-amqp-protocol-2.4.5.Final.jar:na]
> 	at
> org.hornetq.core.protocol.proton.ProtonSession.sendMessage(ProtonSession.java:131)
> ~[hornetq-amqp-protocol-2.4.5.Final.jar:na]
> 	at
> org.hornetq.core.server.impl.ServerConsumerImpl.deliverStandardMessage(ServerConsumerImpl.java:949)
> ~[hornetq-server-2.4.5.Final.jar:na]
> 	at
> org.hornetq.core.server.impl.ServerConsumerImpl.proceedDeliver(ServerConsumerImpl.java:398)
> ~[hornetq-server-2.4.5.Final.jar:na]
> 	at
> org.hornetq.core.server.impl.QueueImpl.proceedDeliver(QueueImpl.java:2544)
> ~[hornetq-server-2.4.5.Final.jar:na]
> 	at org.hornetq.core.server.impl.QueueImpl.deliver(QueueImpl.java:2137)
> ~[hornetq-server-2.4.5.Final.jar:na]
> 	at org.hornetq.core.server.impl.QueueImpl.access$1300(QueueImpl.java:81)
> ~[hornetq-server-2.4.5.Final.jar:na]
> 	at
> org.hornetq.core.server.impl.QueueImpl$DeliverRunner.run(QueueImpl.java:2917)
> ~[hornetq-server-2.4.5.Final.jar:na]
> 	at
> org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:104)
> [hornetq-core-client-2.4.5.Final.jar:na]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> [na:1.8.0_51]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> [na:1.8.0_51]
> 	at java.lang.Thread.run(Unknown Source) [na:1.8.0_51]
> 
> 
> 
> --
> View this message in context:
> http://qpid.2158936.n2.nabble.com/Reading-HornetQ-messages-using-Proton-and-Messaging-API-net-tp7629726.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org