jasonrbriggs / stomp.py

“stomp.py” is a Python client library for accessing messaging servers (such as ActiveMQ or RabbitMQ) using the STOMP protocol (versions 1.0, 1.1 and 1.2). It can also be run as a standalone, command-line client for testing.
Apache License 2.0
495 stars 166 forks source link

content-type not getting set on message in activemq. #321

Closed kristinepetrosyan closed 4 years ago

kristinepetrosyan commented 4 years ago
conn.send(body='{"value":"This is a test"}', content_type="application/json",
    ...:           headers={"Content-Type":"application/json", "persistent":"true"},
    ...:           destination='somequeue'
    ...:         )

When the message is received by the client the content_type is None.

jasonrbriggs commented 4 years ago

Not sure why you have the content_type param, as well as "Content-Type" as an additional header, but I don't see this problem when I test. Have double-checked with activemq and I always get the content type flowing through. For example:

INFO     stomp.py:test_activemq.py:29 ({'content-length': '14', 'expires': '0', 'destination': '/queue/test', 'subscription': '1', 'priority': '4', 'message-id': 'ID:7e503fa43794-41641-1596984987191-3:250:-1:1:1', 'content-type': 'text/blah', 'timestamp': '1597008345472'}, 'this is a test')