atmosphere-stomp

STOMP for Atmosphere

License

License

GroupId

GroupId

org.atmosphere
ArtifactId

ArtifactId

atmosphere-stomp
Last Version

Last Version

0.4
Release Date

Release Date

Type

Type

jar
Description

Description

atmosphere-stomp
STOMP for Atmosphere
Project URL

Project URL

http://github.com/Atmosphere/atmosphere-stomp
Source Code Management

Source Code Management

http://github.com/Atmosphere/atmosphere-stomp

Download atmosphere-stomp

How to add to project

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

Dependencies

compile (4)

Group / Artifact Type Version
org.apache.activemq : apollo-stomp jar 1.7
org.atmosphere : atmosphere-runtime jar 2.4.1
com.fasterxml.jackson.core : jackson-databind jar 2.2.2
org.testng : testng jar 6.8.8

provided (1)

Group / Artifact Type Version
org.apache.geronimo.specs : geronimo-servlet_3.0_spec jar 1.0

test (4)

Group / Artifact Type Version
org.apache.activemq : activemq-stomp jar 5.9.0
org.mockito : mockito-all jar 1.8.5
ch.qos.logback : logback-core jar 1.0.13
ch.qos.logback : logback-classic jar 1.0.13

Project Modules

There are no modules declared in this project.

STOMP implementation for the Atmosphere Framework

To download Atmosphere STOMP, add the following dependency:

     <dependency>
         <groupId>org.atmosphere</groupId>
         <artifactId>atmosphere-stomp</artifactId>
         <version>0.3</version>
      </dependency>

Project state

The protocol support is currently not complete and will be progressively fixed in future releases. To do this, the project will lead new CPR and Javascript enhancements to then take advantage from them.

Consequently, alpha/RC of both projects will be provided when necessary the day we need to release a new version of STOMP support. The following table shows the associated versions:

atmosphere-stomp atmosphere-runtime atmosphere-javascript
0.1 2.2.0-RC1 2.2.0
0.2 2.2.0-RC3 2.2.2
0.3 2.3.0-RC6 2.2.9

Demo

Check out our super simple demo to get started. File issues, do pull requests to help this community. Have questions? Post them here

Quick start

Using STOMP protocol over Atmosphere is very easy.

Server side code

@StompEndpoint
public class StompBusinessService {

    // Invoked when someone push a 'SEND' frame to the '/stomp-destination' destination
    @StompService(destination = "/stomp-destination")
    @Message(encoders = { MyEncoder.class }, decoders = {MyDecoder.class })
    public MyDto doStuff(final MyDto dto) {
        MyDto retval = ...
    
        // Broadcast the result to all '/stomp-destination' subscribers
        return retval;
    }
}

Client side code

// Build atmosphere request object as usual
var request = { {
    url: document.location.protocol + "//" + document.location.host + '/stomp',
    ...
};

// We use Stomp.js here
var client = Stomp.over(new $.atmosphere.WebsocketApiAdapter(request));

// Bind a callback to a subscription
client.subscribe("/stomp-destination", function(e) {
    ...
});

// Send data to the destination
var myDto = { ... };
client.send("/stomp-destination", {}, myDto);
org.atmosphere

Atmosphere Framework

Versions

Version
0.4
0.3
0.2
0.1