Giter Site home page Giter Site logo

activemq-rest's Introduction

ActiveMQ REST

REST wrapper for ActiveMQ.

Requirements

Building the example

$ cd $PROJECT_ROOT
$ mvn clean install

Running the example

Open a terminal window and start the controller.

$ cd $PROJECT_ROOT/activemq-rest-controller
$ mvn camel:run

Open a terminal window and start the sample consumer A.

$ cd $PROJECT_ROOT/activemq-rest-consumer-a
$ mvn camel:run

Open a terminal window and start the sample consumer B.

$ cd $PROJECT_ROOT/activemq-rest-consumer-b
$ mvn camel:run

All interaction with the controller (ie, managing subscriptions, publishing messages, ...) can be done using simple REST calls. So you can, for example, use something as simple as curl. Here are some example commands:

Register subscriber:

$ curl -X POST -H 'Content-Type: application/json' -d '{"url":"http://localhost:8081"}' 'http://localhost:9090/subscriptions/A/TEST.FOO'

Register subscriber with selector:

$ curl -X POST -H 'Content-Type: application/json' -d '{"selector":"foo = '"'"'bar'"'"'","url":"http://localhost:8081"}' 'http://localhost:9090/subscriptions/A/TEST.FOO'

Delete subscriber:

$ curl -X DELETE -H 'Content-Type: application/json' 'http://localhost:9090/subscriptions/A/TEST.FOO'

Get subscription info:

$ curl -X GET -H 'Content-Type: application/json' 'http://localhost:9090/subscriptions/A/TEST.FOO'

Get subscription info (all):

$ curl -X GET -H 'Content-Type: application/json' 'http://localhost:9090/subscriptions/A'

Publish a message:

$ curl -X POST -H 'Content-Type: application/json' -d '{"headers":{"foo": "bar"},"body":"Hello World!"}' 'http://localhost:8080/messages/TEST.FOO'

Load testing

Note: This is a JMS-like implementation over REST. The HTTP protocol was not meant for messaging (since it has to constantly open/close connections). So don't expect the performance you would get with a native JMS messaging solution (ie, using A-MQ directly via a protocol like OpenWire).

Because this is a REST implementation, you can use any HTTP load testing tool that you'd like. If you don't have a favorite, there is a sample Gatling [http://gatling.io/] test located in the $PROJECT_ROOT/activemq-rest-jaxrs-api/src/test/gatling folder.

activemq-rest's People

Contributors

joshdreagan avatar

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.