0

Is there a generic adapter pattern in spring-cloud that will allow you pub/sub a message? Basically allowing you to the change provider type to ampq, kafka, pubsub or jms. Business case is being able to change a pub/sub messaging service, avoiding cloud vendor lock-In. A simple pub/sub unified generic framework. Example code.

    PublisherBuilder builder = adapterFactory.getProvider("pubsub");
    Publisher publisher = builder.withProperties(properties).objectMapper(objectMapper);
    pubisher.publish(mesg);
    

Steve

1 Answers1

1

Spring Cloud Stream does exactly that -- you swap out binders through dependency management.

https://spring.io/projects/spring-cloud-stream

Elena Felder
  • 456
  • 3
  • 8