This Help topic shows what is required to send a AMQP message using Zato. Zato is a Python based enterprise service Bus (ESB) for SOA, converged sing Woo backend services.
Code Demo
Here are some of the code you need:
From Zato.server.service Import Service
Class MyService (Service):
def handle (self):
msg = ' My message '
Conn_name = ' My CRM connection '
Exchange_name = ' My Exchange '
Routing_key = ' '
Self.outgoing.amqp.send (msg, Conn_name, Exchange_name, Routing_key)
Understanding Connection definitions and connections
Before sending the first message, you must let Zato know where to send the message, because by default Zato supports separating the service that generated the message and the actual destination of the message delivery.
In your code, you just call a single. Send method without actually specifying a specific URL or credential, message expiration, content type, and so on. You can specify these, but you don't need to.
All this is done through the connection definition and the true connection. A connection definition is a template that describes the details required to connect to the AMQP agent-the network address of the proxy, the virtual hostname, the username/password, and something like that. Each connection definition can be used to create one or more details that handle sending messages-message priority, distribution mode, and other connections to this message information.
Both types of objects can be created using the Zato graphical interface, or they can be created by other methods such as Enmasse or APIs
Graphical interface
First create a connection definition, and then use it to create an external connection, as shown in the following illustration:
All in all, when you create a new connection and write the code shown earlier, you can hot deploy to send the AMQP message.
other ways to configure
In contrast, alternatively, use the Enmasse tool and API to create, list, update, or delete AMQP connections. is not limited to graphical interface mode.
More examples of Use
Please see the full API and more AMQP use examples here.