Skip to content

jmnarloch/hermes-spring-cloud-starter-stream

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

Spring Cloud Stream Hermes binder

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages