Bauer (a.k.a. stf4j - Simple Topic Facade for Java) serves as a simple facade or abstraction for various topic-based message-queues systems, such as Java Message Service and MQTT. Bauer allows the end-user to plug in the desired message-queue framework at deployment time. Note that Bauer-enabling your library/application implies the addition of only a single mandatory dependency, namely bauer-api.jar.
Bauer has been written with esteem and respect for slf4j, the world famous Simple Logging Facade for Java.
#!xml
<dependency>
<groupId>it.netgrid</groupId>
<artifactId>bauer-api</artifactId>
<version>0.0.15-SNAPSHOT</version>
</dependency>
Topic<MyCustomPayload> myCustomTopic = TopicFactory.getTopic("/my/topic/path");
myCustomTopic.post(new MyCustomPayload("Hello World"));Topic<MyCustomPayload> myCustomTopic = TopicFactory.getTopic("/my/topic/path");
myCustomTopic.addHandler(new EventHandler<MyCustomPayload>() {
@Override
public Class<MyCustomPayload> getEventClass() {
return MyCustomPayload.class;
}
@Override
public String getName() {
return "handler-identifier";
}
@Override
public boolean handle(String topic, MyCustomPayload event) {
System.out.println(event.getMyCustomProperty())
return true;
}
});As mentioned previously, Bauer supports various topic-based event-queues frameworks. Some of them still in development. The Bauer distribution ships with serveral jar files referred as "Bauer bindings", with each binding corresponding to a supported framework.
Binding for MQTT, a M2M/Internet-of-Things connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport.
Bauer relies upon three core concepts: events, topics and event handlers.
An event is a batch of data.
A topic is a stream of events of the same kind, sent at different times from different sources.
Piece of code executed each time a new event occurs in the topic which holds the code
you need access to https://oss.sonatype.org/
check your ~/.m2/settings.xml
<settings>
<servers>
<server>
<id>ossrh</id>
<username>USERNAME</username>
<password>PASSWORD</password>
</server>
</servers>
</settings>
then run in repo
mvn deploy