activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcarlyle <tcarl...@gmail.com>
Subject Re: Unable to connect/send messages with MQTT transport from JMS client
Date Mon, 26 Aug 2013 06:41:08 GMT
That works

Finally, I am doing:

      BytesMessage bmsg = (BytesMessage) msg;
        byte[] actual = new byte[(int) bmsg.getBodyLength()];
        bmsg.readBytes(actual);


which I ended by finding it here:
https://svn.apache.org/repos/asf/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/conversions/AmqpAndMqttTest.java


Thanks!



On Fri, Aug 23, 2013 at 6:46 PM, ceposta [via ActiveMQ] <
ml-node+s2283324n4670621h32@n4.nabble.com> wrote:

> could you just do?
>
>             byte[] buffer = new byte[1024];
>             bytesMessage.readBytes(buffer);
>
>
> On Thu, Aug 22, 2013 at 8:11 AM, tcarlyle <[hidden email]<http://user/SendEmail.jtp?type=node&node=4670621&i=0>>
> wrote:
>
> > Im using the mqtt client library to publish a message in a topic of the
> > activemq broker. And I was wondering how/if is it possible to read such
> > message with a JMS client?
> >
> > As far as I understood the activemq broker would conver the message and
> > indeed my JMS listener receives a message, however when I try to get the
> > bytes of that message using BytesMessage readChar or readUTF methods I
> get
> > a
> > org.apache.activemq.util.JMSExceptionSupport.createMessageEOFException
> >
> > If I convert the message to BytesMessage and do a toString, I get
> > ActiveMQBytesMessage {commandId = 13, responseRequired = true, messageId
> =
> > ID:snf-58412-58115-1377164175964-1:12:-1:1:10, originalDestination =
> null,
> > originalTransactionId = null, producerId =
> > ID:snf-58412-58115-1377164175964-1:12:-1:1, destination =
> > topic://TrustworthinessComponent, transactionId = null, expiration = 0,
> > timestamp = 1377184141693, arrival = 0, brokerInTime = 1377184141694,
> > brokerOutTime = 1377184141697, correlationId = null, replyTo = null,
> > persistent = true, type = null, priority = 4, groupID = null,
> groupSequence
> > = 0, targetConsumerId = null, compressed = false, userID = null, content
> =
> > org.apache.activemq.util.ByteSequence@2bd1e730, marshalledProperties =
> > org.apache.activemq.util.ByteSequence@61a116c9, dataStructure = null,
> > redeliveryCounter = 6, size = 0, properties = {QoSPropertyName=1},
> > readOnlyProperties = true, readOnlyBody = true, droppable = false}
> > ActiveMQBytesMessage{ bytesOut = null, dataOut = null, dataIn = null }
> >
> > Any idea how/if I can get the bytes out with the JMS client?
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://activemq.2283324.n4.nabble.com/Unable-to-connect-send-messages-with-MQTT-transport-from-JMS-client-tp4652674p4670581.html
> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >
>
>
>
> --
> *Christian Posta*
> http://www.christianposta.com/blog
> twitter: @christianposta
>  http://www.christianposta.com/blog
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://activemq.2283324.n4.nabble.com/Unable-to-connect-send-messages-with-MQTT-transport-from-JMS-client-tp4652674p4670621.html
>  To unsubscribe from Unable to connect/send messages with MQTT transport
> from JMS client, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4652674&code=dGNhcmx5bGVAZ21haWwuY29tfDQ2NTI2NzR8LTEyNzAzODc4MzU=>
> .
> NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
------------------------------------------------------
Thomas Carlyle Minetto Vilarinho

Flybilletter Billig kan finnes på: http://www.flybilletterbillig.com




--
View this message in context: http://activemq.2283324.n4.nabble.com/Unable-to-connect-send-messages-with-MQTT-transport-from-JMS-client-tp4652674p4670668.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message