All Projects → mendrugory → conejo

mendrugory / conejo

Licence: MIT license
Conejo is a library based on pma/amqp which will help you to define your AMQP/RabbitMQ publishers and consumers in an easier way.

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to conejo

Enqueue Bundle
[READ-ONLY] Message queue bundle for Symfony. RabbitMQ, Amazon SQS, Redis, Service bus, Async events, RPC over MQ and a lot more
Stars: ✭ 233 (+1564.29%)
Mutual labels:  amqp
amqpprox
An AMQP 0.9.1 proxy server, designed for use in front of an AMQP 0.9.1 compliant message queue broker such as RabbitMQ.
Stars: ✭ 51 (+264.29%)
Mutual labels:  amqp
azure-service-bus-java
☁️ Java client library for Azure Service Bus
Stars: ✭ 61 (+335.71%)
Mutual labels:  amqp
Azure Service Bus Dotnet
☁️ .NET Standard client library for Azure Service Bus
Stars: ✭ 237 (+1592.86%)
Mutual labels:  amqp
the-white-rabbit
The White Rabbit is an asynchronous RabbitMQ (AMQP) client based on Kotlin coroutines
Stars: ✭ 90 (+542.86%)
Mutual labels:  amqp
node-bunnymq
BunnyMQ is an amqp.node wrapper to ease common AMQP usages (RPC, pub/sub, channel/connection handling etc.).
Stars: ✭ 20 (+42.86%)
Mutual labels:  amqp
Gosiris
An actor framework for Go
Stars: ✭ 222 (+1485.71%)
Mutual labels:  amqp
jobs
RoadRunner: Background PHP workers, Queue brokers
Stars: ✭ 59 (+321.43%)
Mutual labels:  amqp
fs2-rabbit
🐰 RabbitMQ stream-based client built on top of Fs2
Stars: ✭ 143 (+921.43%)
Mutual labels:  amqp
aop
AMQP on Pulsar protocol handler
Stars: ✭ 93 (+564.29%)
Mutual labels:  amqp
Aioamqp
AMQP implementation using asyncio
Stars: ✭ 244 (+1642.86%)
Mutual labels:  amqp
dispatcher
Dispatcher is an asynchronous task queue/job queue based on distributed message passing.
Stars: ✭ 60 (+328.57%)
Mutual labels:  amqp
rabbitmq-advanced-spring-boot-starter
A generic library for messaging with rabbit mq with extension on spring boot amqp
Stars: ✭ 85 (+507.14%)
Mutual labels:  amqp
Azure Event Hubs
☁️ Cloud-scale telemetry ingestion from any stream of data with Azure Event Hubs
Stars: ✭ 233 (+1564.29%)
Mutual labels:  amqp
qpid-cpp
Mirror of Apache Qpid C++
Stars: ✭ 77 (+450%)
Mutual labels:  amqp
Akka Rabbitmq
RabbitMq client in Scala and Akka actors
Stars: ✭ 228 (+1528.57%)
Mutual labels:  amqp
lib mysqludf amqp
Publish messages via AMQP directly from MySQL
Stars: ✭ 48 (+242.86%)
Mutual labels:  amqp
qpid-python
Mirror of Apache Qpid Python
Stars: ✭ 15 (+7.14%)
Mutual labels:  amqp
qpid-broker-j
Mirror of Apache Qpid Broker-J
Stars: ✭ 52 (+271.43%)
Mutual labels:  amqp
rabbitChat
A Chat-Server/Chat-System based on AMQP protocol(RabbitMQ) + AMQP Python Client(PIKA) + Websockets(SockJS) + Async Python Server(Tornado)
Stars: ✭ 53 (+278.57%)
Mutual labels:  amqp

Conejo

hex.pm hexdocs.pm Build Status

Conejo is an OTP application/library based on pma/amqp which will help you to define your AMQP/RabbitMQ publishers and consumers in an easier way.

I highly recommend to initiate your publishers/consumers under a Supervisor.

Installation

  • Add conejo to your list of dependencies in mix.exs:

    def deps do
       [{:conejo, "~> 0.6"}]
    end

Configuration

  • Define your config files. Try to respect this configuration. It is based on the options that are needed by pma/amqp.
  • If you whish to use a virtual host, you can specify an optional parameter called "vhost" containing your wanted vhost (eg. "dev").
config :my_application, :consumer,
  exchange: "my_exchange",
  exchange_type: "topic",
  queue_name: "my_queue",
  queue_declaration_options: [{:auto_delete, true}, {:exclusive, true}],
  queue_bind_options: [routing_key: "example"],
  consume_options: [no_ack: true]


config :conejo, 
  host: "my_host",
  port: 5672,
  vhost: "dev",
  username: "user",
  password: "pass"

Confex is supported.

Consumer

  • Define and run your Consumers. Code the function handle_consume(channel, tag, redelivered, payload) which will be executed when a message is received.
defmodule MyApplication.MyConsumer do
  use Conejo.Consumer

  def handle_consume(_channel, payload, _params) do
    IO.puts "Received  ->  #{inspect payload}"
  end
end
   
options = Application.get_all_env(:my_application)[:consumer] 
{:ok, consumer} = MyApplication.MyConsumer.start_link(options, [name: :consumer])

Publisher

  • Define and run your Publisher.
defmodule MyApplication.MyPublisher do
  use Conejo.Publisher

end
   
{:ok, publisher} = MyApplication.MyPublisher.start_link([], [name: :publisher])

#Synchronous
MyApplication.MyPublisher.sync_publish(:publisher, "my_exchange", "example", "Hola")

#Asynchronous
MyApplication.MyPublisher.async_publish(:publisher, "my_exchange", "example", "Adios")

Test

  • Run the tests. You have to have Docker installed in you computer.
mix test --no-start

Internal dependencies

Conejo dependencies use lager for logging, so you have to configure it in your configuration files:

config :lager,
  handlers: [level: :critical]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].