I'm new in using RabbitMQ, here's what i want to do: Input the console output of my other code into the producer, and write the output of the code into the message queue. Is there any sample tutorial for reference? thanks
Related
I am using kafka consumer to consume the message from kafka. I am able to consume the messages when I tired to convert message to JSON or java using data weave. It is not getting transformed. Actually message kept is json. I could see type of message is string. could you please let me know how can we transform data
Try using
ByteArray to Object Transformer
and then
Object to JSON transformer
Alternatively you can also use "Transform message" with required input and output payload.
If you need specific transformation ,kindly specify the flow you are using.
I have a stream defined as stream create --name foo --definition samplesource | sampleprocessor | samplesink --deploy. I'm using Redis as MessageBus.
If sampleprocessor or samplesink is failed, then xd will push failed messages to Redis into ERRORS:foo.n queue. I'm writing code to bring the messages from errors queue to foo.n.
Challenge here is I don't want to hardcode the stream name in my code as this piece is handled across all my xd modules.
Can we get the channel name on the fly ?
Thanks In Advance
I'm writing code...
Where is that code going to run?
If it's within a module in the stream, module metadata is available via the application context environment properties:
${xd.group.name}
${xd.module.label}
${xd.module.type}
${xd.module.sequence}
In RabbitMQ Management Web Interface, looking at Queues tab, I can see message rate chart, and If I want to get json data that was stored for plotting in chart, please give me some suggestions
You can get the current number of messages in the queue via the following URL:
http://<host>:<port>/api/queues/<vhost>/<queue>
That will return JSON, and you would want to look at the messages attribute.
I wanted to know if RabbitMQ has any built capabilities to call an external exe once its message queue get populated. I understand that we can implement task queues/worker queues in rabbitmq but it has to be done by writing an external application(say in java like they have mentioned in tuttorials http://www.rabbitmq.com/tutorials/tutorial-two-java.html) . Please help me out with this
Adding to my previous question :
I have decided to write an application that will run an exe . But i dont want the application that i write to poll my queue. Instead i want my rabbitmq to trigger my application whenever there is a new message by sending a job to process. Can i do this? how can i add jobs to the queues?
You are probably going to have to write your own consumer. The question is what is sending the messages in the first place and what is the format o the message and do you need that data.
Python is probably the best choice for this task.
I am using AMQP Java client i want to use message attributes properties like ,Message priority,Delivery mode, Message publishing timestamp,Expiration period, etc.how to set it on channel.basicPublish();
Have you looked through the RabbitMQ tutorials (http://www.rabbitmq.com/getstarted.html) they have lots of good examples which are in both java and python which should give you a good basis to start using RabbitMQ