Publish json using rabbitmqadmin

The handy dandy rabbitmqadmin tool makes it simple to publish a message, but (possibly depending on the client library at the other end) if you want it to appear as json rather than a string, you need to set a few options:

./rabbitmqadmin publish exchange=foo routing_key=foo.bar.baz \
    properties='{"content_type":"application/json"}' \
    payload='{}' payload_encoding='string'

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s