Reputation: 27
I am new to rabbitmq and I am trying to send a .sh file in rabbitmq. I have setup my queue and exchanges. I am using spring-amqp and I can send json messages with my listerner container
public SimpleMessageListenerContainer messageListenerContainer() {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory());
container.setQueues(topicQueue());
container.setAcknowledgeMode(AcknowledgeMode.AUTO);
container.setMessageListener(new MessageListenerAdapter(pageListener(), jsonMessageConverter()));
return container;
}
but I am not sure how to send a sh file and write it in my pagelistener. Any idea how to do it?
Upvotes: 0
Views: 99
Reputation: 174664
You need to read the file and send the content.
You can use a SimpleMessageConverter
(the default) and if the content_type
property is text/plain
, you'll get a String; otherwise you'll get a byte[]
.
On the receiving side (presumably) you'd have to write it to a file and set the permissions.
Upvotes: 1