Class CamelPublisher
java.lang.Object
org.apache.camel.component.reactive.streams.engine.CamelPublisher
- All Implemented Interfaces:
AutoCloseable
,org.reactivestreams.Publisher<org.apache.camel.Exchange>
public class CamelPublisher
extends Object
implements org.reactivestreams.Publisher<org.apache.camel.Exchange>, AutoCloseable
The Camel publisher. It forwards Camel exchanges to external reactive-streams subscribers.
-
Constructor Summary
ConstructorDescriptionCamelPublisher
(ExecutorService workerPool, org.apache.camel.CamelContext context, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoid
attachProducer
(ReactiveStreamsProducer producer) void
close()
void
void
publish
(org.apache.camel.Exchange data) void
subscribe
(org.reactivestreams.Subscriber<? super org.apache.camel.Exchange> subscriber) void
unsubscribe
(CamelSubscription subscription)
-
Constructor Details
-
CamelPublisher
public CamelPublisher(ExecutorService workerPool, org.apache.camel.CamelContext context, String name)
-
-
Method Details
-
subscribe
public void subscribe(org.reactivestreams.Subscriber<? super org.apache.camel.Exchange> subscriber) - Specified by:
subscribe
in interfaceorg.reactivestreams.Publisher<org.apache.camel.Exchange>
-
unsubscribe
-
publish
public void publish(org.apache.camel.Exchange data) -
attachProducer
-
detachProducer
public void detachProducer() -
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
getSubscriptions
-