Why is AMQP a two-way RPC protocol? - rabbitmq

I read the Pika doc, but I am not quite understand why it says "AMQP a two-way RPC protocol, where the client can send requests to the server and the server can send requests to a client...". Can anyone give me an example please ?
Does it mean when we create a exchange.
client sends: exchange.declare
server replies: exchange.declare-ok
Are these two method requests?

In your particular example exchange.declare is client request and exchange.declare-ok is server response.
Though, there are some methods that server can send to client, e.g. basic.deliver, basic.return, connection.blocked (RabbitMQ-specific extension).

Related

Bidirectional api testing using Karate

I have a client (cwmp) and a server (acs). I want to test the server. Client and server communicate with each other using a bidirectional protocol. Messages are SOAP over HTTP.
Is there a way to test the server using Karate or other framework? I can figure out how to send messages, but not how to receive them.
Thanks in advance.
There is no "magic". You have to do some work to handle the calls coming from "ACS".
Use the pattern in this example: https://github.com/intuit/karate/tree/master/karate-netty#consumer-provider-example
Ask a new specific question if needed.

TCP request/response over a REST API

Our application provides a REST API. However, a client can communicate only over TCP.
Is it possible in WSO2 ESB to make a proxy which would listen to TCP internally, then send the request to a REST API and send out the response as TCP?
The TCP request contains a message ID, which must be sent out in the response in order to be able to couple on the client-side.
You can use TCP transport receiver. Please refer the documentation for more details

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.

Deliver message to consumer and expect response in RabbitMQ

I have a requirement where in (RabbitMQ)server sends the request to the client and client executes the operation and sends the response back to the server.
I would like to know which mechanism to use for this Topic, PubSub, Routing...
Can we create the bi-directional connection like server-client similar to xmpp in rabbit mq, if yes how can we do?
thanks
Lokesh
You can use a Spring AMQP asynchronous consumer with a MessageListenerAdapter to invoke a POJO. See the reference documentation.
If you want more control; use a simple MessageListener and send the reply with a RabbitTemplate.
This test case shows an end-to-end configuration (client side and server side). The client side automatically takes care of setting the correlationId.

Multiple MSMQ communication in WCF

I am using a client server application in which client send request to server in request queue, server receive this request object from queue process it and send response in response queue which is received by client application. I want same functionality in wcf service and client so whether I need to create two different end points for both msmq and if yes than how same client will work with both endpoints.
You should not think of it as strictly a client server application.
You do have a request originator referred to as client and a request processor referred to as Server,
but when thinking WCF- client is the one sending the message, server is the one receiving. Meaning that in WCf terms, at first your client is really a classic "client" and the server is really a classic "server". But when you get to the point after the original request is processed and needs to be sent back- the roles are reversed! the server becomes a WCf client and the client becomes a WCf server.
What this means is that you processes need to expose a separate endpoint for each other. The server listens on a certain EP for incoming messages (requests), and the client listens on a certain EP for incoming messages (responses).
Hope this clarifies things a bit.