Este conteúdo não está disponível no idioma selecionado.
Chapter 3. Getting Started
This chapter guides you through a simple exercise to help you get started using AMQ Python. Before starting, make sure you have completed the steps in the Chapter 2, Installation chapter for your environment.
3.1. Preparing the Broker
				The example programs require a running broker with a queue named examples. Follow these steps to define the queue and start the broker.
			
- Install the broker.
- Create a broker instance. Enable anonymous access.
- Start the broker instance and check the console for any critical errors logged during startup. - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the - artemis queuecommand to create a queue called- examples.- BROKER_INSTANCE_DIR/bin/artemis queue create --name examples --auto-create-address --anycast - $ BROKER_INSTANCE_DIR/bin/artemis queue create --name examples --auto-create-address --anycast- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - You are prompted to answer a series of questions. For yes|no questions, type - N; otherwise, press Enter to accept the default value.
3.2. Running Hello World
				The Hello World example sends a message to the examples queue on the broker and then fetches it back. On success it prints Hello World! to the console.
			
				Using a new terminal window, change directory to the AMQ Python examples directory and run the helloworld.py example.
			
cd /usr/share/proton-0.21.0/examples/python/ python helloworld.py
$ cd /usr/share/proton-0.21.0/examples/python/
$ python helloworld.py
Hello World!