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

Petr Kuzel commented on ARTEMIS-4470:
-------------------------------------

When it comes to AMQP spec interpretation by the broker, it might be reversed.

 

See:

 
{color:#000000} {color}{color:#3f5fbf}/** Callers must call 
{color}{color:#3f3fbf}{@link #reencode()}{color}{color:#3f5fbf} in order to be 
sent to clients */{color}

{color:#000000} {color}{color:#7f0055}default{color}{color:#000000} Message 
setAnnotation(SimpleString {color}{color:#6a3e3e}key{color}{color:#000000}, 
Object {color}{color:#6a3e3e}value{color}{color:#000000}) {{color}

 

 calls for reencode() but:

 
{color:#000000} {color}{color:#3f5fbf}/**{color}

{color:#3f5fbf} * Puts a String property in this message.{color}

{color:#3f5fbf} *{color}

{color:#3f5fbf} * {color}{color:#7f9fbf}@param{color}{color:#3f5fbf} key 
property name{color}

{color:#3f5fbf} * {color}{color:#7f9fbf}@param{color}{color:#3f5fbf} value 
property value{color}

{color:#3f5fbf} */{color}

{color:#000000} Message putStringProperty(String 
{color}{color:#6a3e3e}key{color}{color:#000000}, String 
{color}{color:#6a3e3e}value{color}{color:#000000});{color}

 

{color:#000000} Message putObjectProperty(String 
{color}{color:#6a3e3e}key{color}{color:#000000}, Object 
{color}{color:#6a3e3e}value{color}{color:#000000}) 
{color}{color:#7f0055}throws{color}{color:#000000} 
ActiveMQPropertyConversionException;{color}

 

{color:#000000} Message 
{color}{color:#000000}putObjectProperty{color}{color:#000000}(SimpleString 
{color}{color:#6a3e3e}key{color}{color:#000000}, Object 
{color}{color:#6a3e3e}value{color}{color:#000000}) 
{color}{color:#7f0055}throws{color}{color:#000000} 
ActiveMQPropertyConversionException;{color}

 

does not.

 

Reencode is mentioned for annotations but not for properties. By spec one might 
expect the opposite. 

 

 

IMHO the setAnnotation JavaDoc should be copy&pasted to all properties mutation 
methods JavaDocs.

 

 

[~tabish] I could contribute that simple interface clarification patch. Unless 
you see there some catch, my best understanding still being misleading, wrong 
or incomplete. 

 

  Hope it helps

  Cc.

> Headers loss in message sent from AMQP producer to AMQP consumer
> ----------------------------------------------------------------
>
>                 Key: ARTEMIS-4470
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4470
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: AMQP, Broker
>    Affects Versions: 2.31.0
>            Reporter: Mohanavalli A
>            Priority: Major
>
> Hi Team,
> Our message flow involves a AMQP Producer, Broker (with custom plugin) and a 
> AMQP Consumer.
> The message is sent by Producer to TEST queue with few headers, the broker 
> plugin adds few more headers on BeforeSend event on the TEST queue. When the 
> message is consumed by the consumer from TEST we see loss of certain headers.
>  
> We started facing this after the recent migration of the consumer from 
> Openwire to AMQP protocol. There is no loss of header when the 
> Producer/Consumer is on openwire.
>  
> Scenario1
> ----------
> Producer(AMQP) to TEST
> Header1:String, Header2:long
>  
> Plugin on BeforeSend event on TEST
> Adds two new headers PluginHeader1(String), PluginHeader2(long)
>  
> Consumer(AMQP) from TEST
> Headers : Header1,Header2 (PluginHeader1, PluginHeader2 missing)
>  
> Additional info: 
> If browsing message in console on TEST: Headers : 
> Header1,Header2,PluginHeader1, PluginHeader2 (All headers are present)
> If the message is moved from TEST to TEST1 queue directly on the Web Console, 
> the headers PluginHeader1, PluginHeader2 are lost on TEST1 queue.
>  
>  
> Scenario2
> ----------
> Producer(AMQP)
> Header1:String, Header2:long
>  
> Plugin
> Adds two new headers PluginHeader1(String), PluginHeader2(long)
>  
> Consumer(Openwire)
> Headers : Header1,Header2,PluginHeader1, PluginHeader2 (All headers are 
> present)
>  
> Additional info: 
> If browsing message in console on TEST: Headers : 
> Header1,Header2,PluginHeader1, PluginHeader2 (All headers are present)
> If the message is moved from TEST to TEST1 queue directly on the Web Console, 
> the headers PluginHeader1, PluginHeader2 are lost on TEST1 queue.
>  
> Scenario3
> ----------
> Producer(Openwire)
> Header1:String, Header2:long
>  
> Plugin
> Adds two new headers PluginHeader1(String), PluginHeader2(long)
>  
> Consumer(AMQP)
> Headers : Header1,Header2,PluginHeader1, PluginHeader2 (All headers are 
> present)
>  
> Additional info: 
> If browsing message in console on TEST: Headers : 
> Header1,Header2,PluginHeader1, PluginHeader2 (All headers are present)
> If the message is moved from TEST to TEST1 queue directly on the Web Console, 
> all headers are present TEST1 queue.
>  
> Thanks,
> Mohanavalli A



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to