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

Jiri Daněk commented on ARTEMIS-1035:
-------------------------------------

With 2.4.0 broker, when going AMQP -> Core, and maybe in other cases, there is 
a property {{NATIVE_MESSAGE_ID}} added to the received messages which contains 
the original ID.

JMS allows the broker to modify message id (see discussion 
https://stackoverflow.com/questions/29001655/should-the-jmsmessageid-change-between-publish-and-subscribe,
 it is not clear cut, but this is my understanding of their interpretations of 
it). In particular, it supposedly permits id change when sending and receiving 
to/from a topic (the broker creates multiple copies of the original message, 
and the copies can be considered a different message).

Personally, I'd make this ticked an enhancement, asking that the broker does 
not change the id "needlessly". Definition of which is up to discussion.

Portable JMS applications cannot depend on the id being the same anyways, so 
maybe there is no point at all in preserving it, besides saving time needed to 
recompute new id every time...? Sometimes, if something is not required to be 
preserved, it makes sense to take explicit steps to not preserve it every time 
there is opportunity, so that clients do not get used to something that is not 
guaranteed. Like randomized dictionary iteration order in Python, Go and other 
languages.

> Conversion of MessageID is not working when crossing protocols
> --------------------------------------------------------------
>
>                 Key: ARTEMIS-1035
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1035
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: AMQP, OpenWire
>    Affects Versions: 2.0.0
>            Reporter: Michal Toth
>            Priority: Major
>             Fix For: unscheduled
>
>
> Send a message with Openwire client 
> Receive a message with AMQP client.
> Observe message id property being prefixed & suffixed by some binary or hexa 
> data.
> {noformat}
> java  -jar 
> /var/dtests/node_data/clients/java/aoc/target/aoc7-downstream-ga-5.11.0.redhat-630187.jar
>  sender  --log-msgs dict --broker tcp://localhost:61616 --conn-reconnect True 
> --conn-username admin --conn-password admin --address "myQ" --count 2
> {'redelivered': False, 'reply_to': None, 'id': 
> 'mySuperHost-36303-1489414672954-1:1:1:1:1', 'user_id':None, 
> 'correlation_id': None, 'priority': 4, 'durable': True, 'ttl': 0, 'type': 
> None, 'expiration': 0, 'timestamp': 1489414673301, 'address': 'queue://myQ', 
> 'properties': {}, 'content': None}
> {'redelivered': False, 'reply_to': None, 'id': 
> 'mySuperHost-36303-1489414672954-1:1:1:1:2', 'user_id':None, 
> 'correlation_id': None, 'priority': 4, 'durable': True, 'ttl': 0, 'type': 
> None, 'expiration': 0, 'timestamp': 1489414673324, 'address': 'queue://myQ', 
> 'properties': {}, 'content': None}
> {noformat}
> {noformat}
> /var/dtests/node_data/clients/aac0_receiver  --log-msgs dict --broker 
> admin:admin@localhost:5672 --connection-options "{  sasl_mechanisms : 
> 'PLAIN', protocol : 'amqp1.0' }" --address myQ --count 0
> {'redelivered': False, 'reply_to': None, 'subject': None, 'content_type': 
> None, 'id': None, 'user_id': None, 'correlation_id': None, 'priority': 4, 
> 'durable': True, 'ttl': 0.000000e+00, 'size': 25, 'properties': 
> {'JMSXDeliveryCount': None, '_AMQ_DUPL_ID': 
> 'ID:mySuperHost-36303-1489414672954-1:1:1:1:1', '__HDR_ARRIVAL': 0, 
> '__HDR_BROKER_IN_TIME': 1489414673303, '__HDR_COMMAND_ID': 5, 
> '__HDR_DROPPABLE': False, '__HDR_GROUP_SEQUENCE': 0, '__HDR_MESSAGE_ID': 
> '\\x00\\x00\\x00Jn\\x02\\xffffffae\\x02{\\x00=ID:mySuperHost-36303-1489414672954-1:1\\x00\\x01\\x00\\x01\\x00\\x01',
>  '__HDR_PRODUCER_ID': 
> '\\x00\\x00\\x00F{\\x01+\\x00=ID:mySuperHost-36303-1489414672954-1:1\\x00\\x01\\x00\\x01',
>  'x-amqp-creation-time': 1489414673301, 'x-amqp-delivery-count': 0, 
> 'x-amqp-to': 'myQ', 'x-opt-jms-dest': 0, 'x-opt-jms-msg-type': 0}, 'content': 
> 'Conversion to AMQP error!'}
> {'redelivered': False, 'reply_to': None, 'subject': None, 'content_type': 
> None, 'id': None, 'user_id': None, 'correlation_id': None, 'priority': 4, 
> 'durable': True, 'ttl': 0.000000e+00, 'size': 25, 'properties': 
> {'JMSXDeliveryCount': None, '_AMQ_DUPL_ID': 
> 'ID:mySuperHost-36303-1489414672954-1:1:1:1:2', '__HDR_ARRIVAL': 0, 
> '__HDR_BROKER_IN_TIME': 1489414673325, '__HDR_COMMAND_ID': 6, 
> '__HDR_DROPPABLE': False, '__HDR_GROUP_SEQUENCE': 0, '__HDR_MESSAGE_ID': 
> '\\x00\\x00\\x00Jn\\x02\\xffffffae\\x02{\\x00=ID:mySuperHost-36303-1489414672954-1:1\\x00\\x01\\x00\\x01\\x00\\x02',
>  '__HDR_PRODUCER_ID': 
> '\\x00\\x00\\x00F{\\x01+\\x00=ID:mySuperHost-36303-1489414672954-1:1\\x00\\x01\\x00\\x01',
>  'x-amqp-creation-time': 1489414673324, 'x-amqp-delivery-count': 0, 
> 'x-amqp-to': 'myQ', 'x-opt-jms-dest': 0, 'x-opt-jms-msg-type': 0}, 'content': 
> 'Conversion to AMQP error!'}
> {noformat}
> For example here in amqp qpid-cpp receiver, the ID is there 3 times, as "ID" 
> correct, "__HDR_PRODUCER_ID" and "__HDR_MESSAGE_ID".
> For amqp qpid-jms receiver client the output is similar, but "ID", 
> "__HDR_PRODUCER_ID" and "__HDR_MESSAGE_ID" are all empty.
> But there is "_AMQ_DUPL_ID" which holds proper message id.
> {noformat}
> Unsupported object type org.apache.qpid.proton.amqp.Binary 
> \x00\x00\x00Jn\x02\xae\x02{\x00=ID:dhcp-lab-215.englab.brq.redhat.com-38063-1489413923077-1:1\x00\x01\x00\x01\x00\x01
> Unsupported object type org.apache.qpid.proton.amqp.Binary 
> \x00\x00\x00F{\x01+\x00=ID:dhcp-lab-215.englab.brq.redhat.com-38063-1489413923077-1:1\x00\x01\x00\x01
> {'redelivered': False, 'reply_to': None, 'id': None, 'user_id':None, 
> 'correlation_id': None, 'priority': 4, 'durable': True, 'ttl': 0, 'type': 
> None, 'expiration': 0, 'timestamp': 1489413923459, 'address': 'myQ', 
> 'properties': {'__HDR_COMMAND_ID': 5, 'JMSXDeliveryCount': 1, 
> '__HDR_ARRIVAL': 0, '__HDR_MESSAGE_ID': , '__HDR_GROUP_SEQUENCE': 0, 
> '__HDR_PRODUCER_ID': , '__HDR_DROPPABLE': False, '__HDR_BROKER_IN_TIME': 
> 1489413923463, '_AMQ_DUPL_ID': 
> 'dhcp-lab-215.englab.brq.redhat.com-38063-1489413923077-1:1:1:1:1'}, 
> 'content': 'Message content of msg number 1'}
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to