2016-05-18 7 views
1

Ich habe ein Shell-Skript, das Textnachrichten über amqp-publish an einen Java Spring RabbitMQ-Server sendet.JSON über amqp-publish von bash senden

amqp-publish -u amqp://guest:[email protected]/%2f -r "queue.udrive.ustorage" -e "directExchangeUdrive" -b "$msg" 

Deshalb möchte ich eine JSON-Nachricht senden, und ich habe wie diese, aber ich Fehler bekam ...

amqp-publish -u amqp://guest:[email protected]/%2f -r "queue.udrive.ustorage" -e "directExchangeUdrive" -p -C application/json "$msg" 
Usage: amqp-publish [-?] [-u|--url=amqp://...] [-s|--server=hostname] [--port=port] [--vhost=vhost] [--username=username] 
     [--password=password] [--ssl] [--cacert=cacert.pem] [--key=key.pem] [--cert=cert.pem] [-e|--exchange=exchange] 
     [-r|--routing-key=routing key] [-p|--persistent] [-C|--content-type=content type] [-t|--reply-to=reply to] 
     [-l|--line-buffered] [-E|--content-encoding=content encoding] [-b|--body=body] [-?|--help] [--usage] [OPTIONS]... 

Antwort

1

hinzufügen -b Parameter vor "$msg"

amqp-publish -u amqp://guest:[email protected]/%2f -r "queue.udrive.ustorage" -e "directExchangeUdrive" -p -C application/json-b"$msg"