Calling the authentication service

If you remember the initial use case, CCM wants to interact with the authentication service from the Ruby-on-Rails back office application. Therefore, you will implement the client in Ruby. The code you came up with is reproduced as follows:

channel = AMQP::Channel.new(connection) channel.on_error do |ch, channel_close| connection.close { EventMachine.stop } raise "Channel error: #{channel_close.inspect()}" end channel.headers( 'internal-services', :durable => true, :auto_delete => false, :passive => true) do |exchange| channel.queue('', :exclusive => true, :durable => false, :auto_delete => true) do |response_queue| response_queue.subscribe do |metadata, payload| handle_response(metadata.content_type, payload) ...

Get RabbitMQ Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.