← Back to the chapter · Previous detail · Next detail →
Technical detail · AMQP Frames: Routing and Reliability
Similar publish calls across client languages
Each example publishes data to the existing orders exchange with routing key new. The common operation helps application design; the selected client and broker must still agree on a protocol.
# Python (pika)
channel.basic_publish(exchange='orders', routing_key='new', body=data)
# JavaScript (amqplib)
channel.publish('orders', 'new', Buffer.from(data))
# Java (RabbitMQ)
channel.basicPublish("orders", "new", null, data.getBytes())