This Help topic shows what you need to use Zato to send AMQP messages. Zato is a python-based enterprise service Bus (ESB) for SOA, cloud-Sing woo backend services.
Code Demo
Here are some of the required code:
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, and you don't really need to specify a specific URL or credential, message expiration time, content type, and so on. You can specify these, but you don't need them.
All of this is done through connection definitions and real connections. 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 connections that handle the details of the message to be sent-message priority, distribution mode, and other message information.
Both of these object types can be created using the Zato graphical interface, or by other means such as Enmasse or API.
Graphical interface
First create a connection definition, and then use it to create an external connection, as shown in:
In summary, after creating a new connection and writing the code shown earlier, you can send the AMQP message in a hot deployment.
Other ways to configure
Instead, alternatively, use the Enmasse tool and API to create, list, update, or delete AMQP connections. is not limited to graphical interface methods.
More examples of Use
Please see the full API and more examples of AMQP usage here.