Coder Social home page Coder Social logo

camel-ironmq's Introduction

camel-ironmq

This component has been donated to Apache Camel, and will be maintained there.

Ironmq component for Apaceh Camel to support integration with IronMQ an elastic and durable hosted message queue service.

The master branch targets IronMq v3 while v2 is supported using the v2 branch.

To run it requires a IronMQ account with projectId and token.

See examples below or the unit tests for how to use Camel and IronMQ together.

Status

Build Status

Uri format:

ironmq://queue-name[?options]

URI options:

Name Default value Context Description
client null Shared Reference to a io.iron.ironmq.Client in the Registry.
projectId null Shared IronMQ projectid
token null Shared IronMQ token
ironMQCloud https://mq-aws-us-east-1.iron.io Shared IronMq Cloud url. See IronIo documents for valid options
preserveHeaders false Shared Should Camel headers be preserved. This will add the Camel headers to the Iron MQ message body as a json payload with a header list, and a message body. This is useful when Camel is both consumer and producer.
concurrentConsumers 1 Consumer Number of concurrent consumers.
timeout 60 Consumer After timeout (in seconds), item will be placed back onto the queue
maxMessagesPerPoll 1 Consumer How many messages pr. poll.
batchDelete false Consumer Should messages be deleted in one batch. This will limit the number of api requests since messages are deleted in one request, instead of one pr. exchange. If enabled care should be taken that the consumer is idempotent when processing exchanges.
wait 0 Consumer Time in seconds to wait for a message to become available. This enables long polling. Default is 0 (does not wait), maximum is 30.
visibilityDelay 0 Producer The item will not be available on the queue until this many seconds have passed. Default is 0 seconds.

The camel message body

Should be either a String or a array of Strings. In the latter case the batch of strings will be send to IronMq as one request, creating one message pr. element in the array on IronMq.

Message headers set by the IronMQ producer

Header Type Description
CamelIronMQOperation String If value set to 'CamelIronMQClearQueue' the queue is cleared of unconsumed messages.
CamelIronMQMessageId String or io.iron.ironmq.Ids The id of the IronMQ message as a String when sending a single message, or a Ids object when sending a single batch list of string messages.

Message headers set by the IronMQ consumer

Header Type Description
CamelIronMQMessageId String The id of the IronMQ message consumed.
CamelIronMQReservationId String The reservation of the IronMQ message.
CamelIronMQReservedCount String The number of times this message has been reserved.

Consumer example

  • Consume 50 messages pr. poll from the queue 'testqueue', and save the messages to disk.

      from("ironmq:testqueue?projectId=myIronMQProjectid&token=myIronMQToken&maxMessagesPerPoll=50").to("file:somefolder)
    

Producer example

  • Take the direct input and enqueue it on 'testqueue'.

      from("direct:start").to("ironmq:testqueue?projectId=myIronMQProjectid&token=myIronMQToken").
    
  • Dequeue from activemq/jms and enqueue the message on Ironmq.

      from("activemq:foo).to("ironmq:testqueue?projectId=myIronMQProjectid&token=myIronMQToken").
    

There is a jms example here https://github.com/pax95/ironmq-jms-example

Building from source

$ git clone git://github.com/pax95/camel-ironmq.git $ cd camel-ironmq $ mvn clean install

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.