mod-stomp-io

Asynchronous STOMP bus module for Vert.x

License

License

GroupId

GroupId

com.jetdrone
ArtifactId

ArtifactId

mod-stomp-io
Last Version

Last Version

1.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

mod-stomp-io
Asynchronous STOMP bus module for Vert.x
Project URL

Project URL

https://github.com/pmlopes/mod-stomp-io
Source Code Management

Source Code Management

https://github.com/pmlopes/mod-stomp-io.git

Download mod-stomp-io

How to add to project

<!-- https://jarcasting.com/artifacts/com.jetdrone/mod-stomp-io/ -->
<dependency>
    <groupId>com.jetdrone</groupId>
    <artifactId>mod-stomp-io</artifactId>
    <version>1.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.jetdrone/mod-stomp-io/
implementation 'com.jetdrone:mod-stomp-io:1.1.2'
// https://jarcasting.com/artifacts/com.jetdrone/mod-stomp-io/
implementation ("com.jetdrone:mod-stomp-io:1.1.2")
'com.jetdrone:mod-stomp-io:jar:1.1.2'
<dependency org="com.jetdrone" name="mod-stomp-io" rev="1.1.2">
  <artifact name="mod-stomp-io" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.jetdrone', module='mod-stomp-io', version='1.1.2')
)
libraryDependencies += "com.jetdrone" % "mod-stomp-io" % "1.1.2"
[com.jetdrone/mod-stomp-io "1.1.2"]

Dependencies

test (3)

Group / Artifact Type Version
io.vertx : testtools jar 2.0.3-final
junit : junit jar 4.11
com.rabbitmq : amqp-client jar 3.3.4

Project Modules

There are no modules declared in this project.

Stomp busmod for Vert.x

Build Status

This module allows communcation between Message brokers such as ActiveMQ, RabbitMQ Apache Apollo.

Support the development of this module

Click here to lend your support to: Support com.jetdrone Vert.x modules and make a donation at www.pledgie.com !

Quick and Dirty Guide:

First deploy the module:

eb = vertx.eventBus()
container.deployModule('com.jetdrone~mod-stomp-io~1.1.2', [address: 'my-address'], 1)

The config json accepts the following optional parameters:

  • "host" default: "localhost"
  • "port" default 61613
  • "login" default null
  • "passcode" default: null

Second send/receive messages:

eb.send(address, [command: "send", destination: "/queue/FOO.BAR", body: "Hello, queue FOO.BAR"]) { reply ->
    if (reply.body.status == 'OK') {
        // ...
    }
}

// sync messages (wait for ACK)
eb.send(address, [command: "send", destination: "/queue/FOO.BAR", body: "Hello, queue FOO.BAR", sync: true]) { reply ->
    if (reply.body.status == 'OK') {
        // ...
    }
}

Work pub/sub mode:

    // register a handler for the incoming message
    eb.registerHandler("${address}/queue/unsub", new Handler<Message<JsonObject>>() {
        @Override
        void handle(Message<JsonObject> received) {
            def value = received.body.getField('value')
            assertNotNull(value)
            testComplete()
        }
    });

    eb.send(address, [command: "send", destination: "/queue/unsub", body: "Hello, queue unsub"]) { reply0 ->
        stomp([command: "subscribe", destination: "/queue/unsub"]) { reply1 ->
            def id = reply1.body.getString("id")

            // sleep 1 second to avoid receiving any old intransit messages
            vertx.setTimer(1000, new Handler<Long>() {
                @Override
                public void handle(Long event) {
                    stomp([command: "unsubscribe", id: id]) { reply2 ->
                        testComplete()
                    }
                }
            });
        }
    }

Versions

Version
1.1.2
1.1.1
1.1.0
1.0.2
1.0.1
1.0.0
1.0.0-beta3
1.0.0-beta2
1.0.0-beta1