Este conteúdo não está disponível no idioma selecionado.
Chapter 4. Examples
This chapter demonstrates the use of AMQ Python through example programs. To run them, make sure you have completed the steps in the Chapter 2, Installation chapter for your environment and you have a running and configured broker.
See the Qpid Proton Python examples for more sample programs.
4.1. Sending Messages
				This client program connects to a server using CONNECTION_URL, creates a sender for target ADDRESS, sends a message containing MESSAGE_BODY, closes the connection, and exits.
			
Example: Sending Messages
Running the Example
				To run the example program, copy it to a local file and invoke it using the python command.
			
python send.py amqp://localhost queue1 hello
$ python send.py amqp://localhost queue1 hello4.2. Receiving Messages
				This client program connects to a server using CONNECTION_URL, creates a receiver for source ADDRESS, and receives messages until it is terminated or it reaches COUNT messages.
			
Example: Receiving Messages
Running the Example
				To run the example program, copy it to a local file and invoke it using the python command.
			
python receive.py amqp://localhost queue1
$ python receive.py amqp://localhost queue1