[ 
https://issues.apache.org/jira/browse/AMQ-7043?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrey Paramonov updated AMQ-7043:
----------------------------------
    Description: 
It is expected that the following code pushes MapMessage:

--------
import requests
import json

def to_map_json(obj):
    return json.dumps({'map':
                       {'entry':
                        [{'string': [str(key), str(value)]}
                         for key, value in obj.items()]}})


with requests.Session() as s:
    s.auth = ('admin', 'admin')

    print(s.post('http://localhost:8161/api/message/test',
                 params={'type': 'queue', 'transformation': 'jms-map-json'},
                 data=to_map_json({'field1': 'value', 'field2': 'another 
value'}),
                 headers={'Content-Type': 'text/plain'}))
--------

However, currently ApacheMQ doesn't recognize 'transformation' parameter, and 
the message is received as TextMessage.

  was:
It is expected that the following code pushes MapMessage:

{{import requests
import json

def to_map_json(obj):
    return json.dumps({'map':
                       {'entry':
                        [{'string': [str(key), str(value)]}
                         for key, value in obj.items()]}})


with requests.Session() as s:
    s.auth = ('admin', 'admin')

    print(s.post('http://localhost:8161/api/message/test',
                 params={'type': 'queue', 'transformation': 'jms-map-json'},
                 data=to_map_json({'field1': 'value', 'field2': 'another 
value'}),
                 headers={'Content-Type': 'text/plain'}))
}}

However, currently ApacheMQ doesn't recognize 'transformation' parameter, and 
the message is received as TextMessage.


> Should support transformation from REST API
> -------------------------------------------
>
>                 Key: AMQ-7043
>                 URL: https://issues.apache.org/jira/browse/AMQ-7043
>             Project: ActiveMQ
>          Issue Type: Improvement
>            Reporter: Andrey Paramonov
>            Priority: Major
>
> It is expected that the following code pushes MapMessage:
> --------
> import requests
> import json
> def to_map_json(obj):
>     return json.dumps({'map':
>                        {'entry':
>                         [{'string': [str(key), str(value)]}
>                          for key, value in obj.items()]}})
> with requests.Session() as s:
>     s.auth = ('admin', 'admin')
>     print(s.post('http://localhost:8161/api/message/test',
>                  params={'type': 'queue', 'transformation': 'jms-map-json'},
>                  data=to_map_json({'field1': 'value', 'field2': 'another 
> value'}),
>                  headers={'Content-Type': 'text/plain'}))
> --------
> However, currently ApacheMQ doesn't recognize 'transformation' parameter, and 
> the message is received as TextMessage.



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

Reply via email to