Giter Club home page Giter Club logo

wfs-jms's Introduction

WildFly Swarm JAX-RS & Message Driven Bean

This examples uses JAX-RS resource implementations and deploys them through a user-provided main()method.

It also configures a JMS server with two JMS destinations: Queue with name "sample-queue" Topic with name "sample-topic"

The SampleTopicMDBconsumes from the topic.

Project pom.xml

The project is a normal maven project with jar packaging, not war.

<packaging>jar</packaging>

The project adds a <plugin> to configure wildfly-swarm-plugin to create the runnable .jar.

<plugin>
  <groupId>org.wildfly.swarm</groupId>
  <artifactId>wildfly-swarm-plugin</artifactId>
  <version>${version.wildfly-swarm}</version>
  <configuration>
    <mainClass>sample.Main</mainClass>
  </configuration>
  <executions>
    <execution>
      <goals>
        <goal>package</goal>
      </goals>
    </execution>
  </executions>
</plugin>

To define the needed parts of WildFly Swarm, some dependencies are added

<dependency>
  <groupId>org.wildfly.swarm</groupId>
  <artifactId>weld-jaxrs</artifactId>
  <version>${version.wildfly-swarm}</version>
</dependency>
<dependency>
  <groupId>org.wildfly.swarm</groupId>
  <artifactId>messaging</artifactId>
  <version>${version.wildfly-swarm}</version>
</dependency>
<dependency>
  <groupId>org.wildfly.swarm</groupId>
  <artifactId>ejb</artifactId>
  <version>${version.wildfly-swarm}</version>
</dependency>

Project main()

This project supplies a main() in order to configure the messaging subsystem and deploy all the pieces of the application.

You can run it:

  • mvn package && java -jar ./target/wildfly-swarm-example-messaging-mdb-swarm.jar
  • mvn wildfly-swarm:run
  • In your IDE run the org.wildfly.swarm.examples.messaging.mdb.Main class

Use via Browser

http://localhost:8080/

The MDB will log the received message to the console:

2016-08-03 08:23:16,922 INFO  [sample.SampleTopicMDB] (Thread-117 (ActiveMQ-client-global-threads-1211290936)) received: Test Message

Remote JMS

run sample.client.HelloWorldJMSClient

wfs-jms's People

Contributors

myfear avatar kenfinnigan avatar rosiecki avatar

Stargazers

Janfy avatar Walter Verdino avatar Fernando Moraes avatar Armen avatar Vasiliy Bukharev avatar Hantsy Bai avatar Thufir avatar Serge Simard avatar

Watchers

James Cloos avatar  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.