Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

support HTTP / webhook style subscriptions #259

Closed
jstrachan opened this issue Mar 30, 2016 · 2 comments
Closed

support HTTP / webhook style subscriptions #259

jstrachan opened this issue Mar 30, 2016 · 2 comments

Comments

@jstrachan
Copy link
Contributor

it'd be great if we could support clients subscribing to destinations using a HTTP POST to some endpoint. So a regular REST endpoint could subscribe to a destination's messages using annotations on the pod.

This would make it easy for developers to write simple REST endpoints which can work with reliable messaging.

Then the gateway (or some other microservice) would consume on the pods behalf and when a message is received, it would invoke the REST endpoint after converting the message to the given payload and HTTP headers. e.g. convert the payload to JSON / YAML / XML and convert the JMS headers into HTTP headers. Then if the REST endpoint returns a 2XX code that acts as an ACK, otherwise the request is retried up to the usual retry policy.

Note that the REST services should ideally use idempotency as there is the chance of duplicates if the message gateway were to fail after the REST service returns a 2XX and before the message is acked; or the REST service fails after sending a 2XX code before the gateway sees the response.

Note that it might be easiest to implement this generically using Camel like this:
fabric8io/fabric8#5762

@jstrachan
Copy link
Contributor Author

actually the funktion-operator is an implementation of this idea.

I guess one other option is for a Service to be annotated with a Subscription too!

@jstrachan
Copy link
Contributor Author

gonna mark this as closed as we can use a funktion subscription for this now and include the resource with the HTTP based application; or deploy it separately if required.

e.g. here's an example:
https://github.com/fabric8io/funktion-operator/blob/master/examples/subscription1.yml

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant