[ 
https://issues.apache.org/jira/browse/QPIDJMS-49?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14545506#comment-14545506
 ] 

Robbie Gemmell commented on QPIDJMS-49:
---------------------------------------

Ok, I was slightly wrong in what I said yesterday, and this turned out to be 
more complicated than I guessed too.

The client is already treating Data sections without a content-type as a 
BytesMessage as expected. What it wasnt doing yet is treating Data sections 
with an unknown content types as BytesMessages. I've made some changes that 
resolves that.

When using AMQP 1.0, qpid-send does not send messages with Data sections as I 
guessed and doesnt set the content-type either, it always sends a Amqp-Value 
section with Binary whether asked to send n bytes or given a particular content 
string (well, prior to Gordon's commit in http://svn.apache.org/r1679556 after 
I enquired about sending strings). That all worked fine when I tried it out, 
which was interesting. The issue occurs when you use qpid-send with AMQP 0.10 
to send messages to the broker, and then consume them with the JMS client. When 
converted to AMQP 1.0 to send to the client, the messages ended up with Data 
sections and an empty Symbol as the content-type because the original 0-10 
message had an empty but present content type value. The client then failed to 
handle that as above, neither counting it as 'no content type' or handling 
'unknown content type' correctly.

> handle messages with an unknown content-type
> --------------------------------------------
>
>                 Key: QPIDJMS-49
>                 URL: https://issues.apache.org/jira/browse/QPIDJMS-49
>             Project: Qpid JMS
>          Issue Type: Bug
>          Components: qpid-jms-client
>    Affects Versions: 0.1.0
>            Reporter: Jakub Scholz
>            Assignee: Robbie Gemmell
>
> When a message is received, the client tries to decode the message and 
> transform it to JmsMessage. However, the decoding of the message suceeds only 
> when the message:
> - has the JMS_MSG_TYPE annotation
> - or has a content type
> - or the content has a specific AMQP type
> However, if the message doesn't match any of these, the client simply returns 
> it back to the broker just with a warning:
> 2015-05-14 14:25:53 +0200 WARN org.apache.qpid.jms.provider.amqp.AmqpConsumer 
> - Error on transform: Could not create a JMS message from incoming message
> When using the Qpid JMS API with the Qpid C++ broker, it seems to happen 
> quite often that the messages falls into this category. For example the 
> qpid-send utility (+ other clients based on the C++ API) tends to produce 
> this kind of messages.
> Wouldn't it be better to transform such messages to BytesMessages? IMHO a 
> client application with some additional knowledge about the message content 
> might be able to process the payload correctly.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to