hermes-spring-cloud-starter-stream

Spring Cloud Stream Hermes Binder

License

License

Categories

Categories

Hermes Application Layer Libs Messaging
GroupId

GroupId

io.jmnarloch
ArtifactId

ArtifactId

hermes-spring-cloud-starter-stream
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

hermes-spring-cloud-starter-stream
Spring Cloud Stream Hermes Binder
Project URL

Project URL

https://github.com/jmnarloch/hermes-spring-cloud-starter-stream
Source Code Management

Source Code Management

https://github.com/jmnarloch/hermes-spring-cloud-starter-stream.git

Download hermes-spring-cloud-starter-stream

How to add to project

<!-- https://jarcasting.com/artifacts/io.jmnarloch/hermes-spring-cloud-starter-stream/ -->
<dependency>
    <groupId>io.jmnarloch</groupId>
    <artifactId>hermes-spring-cloud-starter-stream</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.jmnarloch/hermes-spring-cloud-starter-stream/
implementation 'io.jmnarloch:hermes-spring-cloud-starter-stream:0.2.0'
// https://jarcasting.com/artifacts/io.jmnarloch/hermes-spring-cloud-starter-stream/
implementation ("io.jmnarloch:hermes-spring-cloud-starter-stream:0.2.0")
'io.jmnarloch:hermes-spring-cloud-starter-stream:jar:0.2.0'
<dependency org="io.jmnarloch" name="hermes-spring-cloud-starter-stream" rev="0.2.0">
  <artifact name="hermes-spring-cloud-starter-stream" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.jmnarloch', module='hermes-spring-cloud-starter-stream', version='0.2.0')
)
libraryDependencies += "io.jmnarloch" % "hermes-spring-cloud-starter-stream" % "0.2.0"
[io.jmnarloch/hermes-spring-cloud-starter-stream "0.2.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.springframework.cloud : spring-cloud-stream jar 1.0.2.RELEASE
pl.allegro.tech.hermes : hermes-client jar 0.8.8
org.springframework.boot : spring-boot-configuration-processor Optional jar 1.3.5.RELEASE

test (7)

Group / Artifact Type Version
org.mockito : mockito-all jar 1.10.19
org.springframework.boot : spring-boot-starter-web jar 1.2.5.RELEASE
junit : junit jar 4.12
com.github.tomakehurst : wiremock jar 1.58
org.springframework.boot : spring-boot-starter-test jar 1.2.5.RELEASE
org.springframework.cloud : spring-cloud-stream-binder-test jar 1.0.2.RELEASE
org.awaitility : awaitility jar 2.0.0

Project Modules

There are no modules declared in this project.

Spring Cloud Stream Hermes binder

A Sprning Cloud Stream binder for Allegro Hermes

Build Status Coverage Status

Setup

Add the Spring Cloud starter to your project:

<dependency>
  <groupId>io.jmnarloch</groupId>
  <artifactId>hermes-spring-cloud-starter-stream</artifactId>
  <version>0.2.0</version>
</dependency>

Features

This project adds a binder for Allegro Hermes to Spring Cloud Stream.

By the way the Hermes has been designed there is no simple way to create a consumer so at this point only binding a producer MessageChannel is being supported.

Creating the binding

Creating the bindings for the Spring Cloud Stream is straightforward process and has been described in Spring Cloud Stream reference guide

You can always bind to the generic Source.class using @EnableBinding and afterwards specify the final destination through the properties:

spring:
  cloud:
    stream:
      bindings:
        output:
          destination: 'io.jmnarloch.events.purchases'

This way you specify the fully qualified name of the Hermes topic.

Alternative approach is to design the your own binding, example:

interface Events {

        @Output
        MessageChannel purchases();
}

In this case the topic name will be establish based on the method name, if you want to use specific topic name you can do this by specific the value of the @Output annotation. Alternatively you can use the binding properties as showed above.

Binder properties

spring.cloud.stream.hermes.binder.uri - specifies the Hermes producer URI

License

Apache 2.0

Versions

Version
0.2.0
0.1.0