Skip to content

iotinga/bauer

Repository files navigation

BAUER

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.

How to include Bauer in your project

#!xml
<dependency>
  <groupId>it.netgrid</groupId>
  <artifactId>bauer-api</artifactId>
  <version>0.0.15-SNAPSHOT</version>
</dependency>

Bauer send event sample

Topic<MyCustomPayload> myCustomTopic = TopicFactory.getTopic("/my/topic/path");
myCustomTopic.post(new MyCustomPayload("Hello World"));

Bauer event handler sample

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;
	}
});

Binding with a event-queue framework at deployment time

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.

bauer-mqtt [DEVELOPMENT]

Binding for MQTT, a M2M/Internet-of-Things connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport.

Concepts

Bauer relies upon three core concepts: events, topics and event handlers.

Event

An event is a batch of data.

Topic

A topic is a stream of events of the same kind, sent at different times from different sources.

Event Handlers

Piece of code executed each time a new event occurs in the topic which holds the code

...one more thing!

Who was Bauer?

Deploy

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages