Cannot see the message body in activeMq when message sent through wso2 esb - activemq

I am new to this.I created a jms message store in wso2 esb and sent a message to it.message was received in activeMq but cannot see the message body in Activemq.
Message Details:
org.apache.synapse.message.store.impl.commons.StorableMessage#79f1d1d8

As ESB using jms message stores to store messages as objects, you can't see the message body via activemq. You can use message processor to get messages from the store and then use it in whatever the process you want.
As ESB use message store purely for storing process, it will use exact format. That is why you have to use processors to work with stored messages.

Related

Message is still processed even after client request timeout in MassTransit

I am implementing standard request/response scenario with MT and RabbitMQ. Client is Asp.net core API and consumer is a windows service.
As part of testing the exception cases if I stop the consumer and submit a request from API using request client, since there is no consumer processing, API got request timeout exception which is cool. But the message is sitting in the consumer queue and when I start the consumer, it picks the message and process the stuff( sending the message to external endpoint) and moved to a _skipped queue as there is no request client listening for this message.
Do you think it is correct behavior? First place when the api got request timeout exception, he will retry anyway so what’s the point of processing first message still?
How can I ignore those message where request clients were already finished processing with any error?
Thanks
What you are describing is very common, and I'd recommend reading up on idempotence and other distributed system failure scenarios.
Sending commands (the request, in this case) and conveying outcomes via a timeout in a message-based system can be very misleading. For instance, if you look at the ForkJoint, in the event of a request timeout, the response is actually a 202/Accepted instead of communicating an error.
The message is in the queue, it will be processed, so there is no reason to fail the controller and report an error back to the caller. So an intermediate response is used instead.
The sample is part of MassTransit Season 3 where I discuss a new idiom to deal with eventual completion/failure of commands in distributed systems. There might be some useful examples in there to help you understand the failure scenarios.
As doc sayed, to discard skipped messages so they are not moved to the _skipped queue:
cfg.ReceiveEndpoint("input-queue", ec =>
{
ec.DiscardSkippedMessages();
});

I want to a send message to a specific consumer in RabbitMQ. Do you have a solution?

I want to a send message to a specific consumer in RabbitMQ. Do you have a solution?
In RabbitMQ, you cannot send a message to a specific consumer. You maintain a queue for the specific consumer which listens to that queue. Then, you route the message to the queue using a routing key. You can use a exchange which routes the specific message to the specific queue.

WSO2 ESB - can it support concept with bridging webservice and MQ messages?

is it possible to implement following concept with WSO2 ESB:
http listener for webservices with a method to be called (SOAP)
java routine to process message
same routine to put message to MQ queue Q1
same routine to get answer message from MQ queue Q2
return with processed answered message to webservice caller
or it's better to go with J2EE server and handle messaging part fully through java code?
Regards, Nikola
Well now usecase is much more clear so that we can go ahead and implement it. There are two ways of doing this.
First Approach
Write a Proxy(HTTP to JMS) service which accepts HTTP requests and
place it in JMS Q1 using the jms sender.
Then write another proxy (JMS to JMS), which picks the messages from
JMS Q1, process it and place it in JMS Q2.
Finally create another proxy (JMS to HTTP) to get the message from
JMS Q2 and send it back to the client using the respond mediator.
Second Approach
Create a proxy service (HTTP to JMS) and use store mediator to store the message into JMS Q1.
Create a Forwarding Message Processor to listen to Q1 and pick the message, process it, place it in Q2.
Then create another forwarding message processor to listen to Q2, and send it back to the client using a reply sequence in the message processor.
Choose which ever the way you like and let me know how it goes.
You can use ESB to implement this. But your usecase is not that clear to me. Appreciate if you can explain your usecase in functional perspective. Anyway you have HTTP(S)/JMS listeners and senders with ESB . You can't listen to a SOAP web service using ESB. What you can do is listen to HTTP traffic. Create a proxy that listens to HTTP traffic and send the message to JMS queue Q1 ussing JMS end point. Then write a JMS listener proxy to listen to the answers in Q2. Once it is received you can call the endpoint web service using send or call mediator. This is how I understood your usecase. I have no idea on transformation of data in Q1 and place it in to Q2 due to wired requirements specified above. It looks simple HTTP to JMS switching usecase to me.

Push message from HTTP endpoint to JMS endpoint in Mule

I am new to Mule ESB. Currently i am handling a project, where we are using Mule as message broker. Requirement is client will call a SOAP web service (request-response) published in Mule ESB. In the server request will be accepted and return a correlation id in the ws response to the client, but at the same time service will also put request payload in the JMS queue for async processing. The JMS queue is also maintained in the Same Mule ESB. Could you please help me how HTTP endpoint can push to JMS endpoint in Mule ESB?
This is very simple, if you want to put your soap request in a JMS queue along the call to the SOAP web service exposed in the Mule, then what you can do is after your HTTP listener in the flow, you need to put a Async block (reference :- https://docs.mulesoft.com/mule-user-guide/v/3.6/async-scope-reference) and in that Async block you can use Object to String Transformer followed by you JMS outbound end point.
This Async block block will create a separate thread from the flow and will push your SOAP request to the JMS queue along with your SOAP web service which accept the request and return a correlation id in the ws response to the client as you reuired.
Remember anything you put inside <async/> is considered as an async block and will used as a separate thread. You need to put this after your HTTP listener in the flow as mentioned above.

Log paylod of JMS message that sent using spring JmsTemplate with domain object - ActiveMQ

I am using ActiveMQ as a JMS provider, and spring-jms as JMS-producer.
When I send a JMS message to the broker as javax.jms.TextMessage, the payload of the message is logged in ActiveMq logs (\data\activemq.log). So if I send "abc" as a TextMessage, I see also in ActiveMq logs 'text = abc'.
When I send the message as one of my domain model objects, using spring JmsTemplate.convertAndSend method, the payload is not logged as the toString() of the domain model object in ActiveMQ logs. It is logged as a reference to an Object.
How can the domain model object be logged as its toString() in ActiveMq log?