Class CamelSubscription
java.lang.Object
org.apache.camel.component.reactive.streams.engine.CamelSubscription
- All Implemented Interfaces:
org.reactivestreams.Subscription
Represents a contract between a Camel published and an external subscriber. It manages backpressure in order to deal
with slow subscribers.
-
Constructor Summary
ConstructorsConstructorDescriptionCamelSubscription
(String id, ExecutorService workerPool, CamelPublisher publisher, String streamName, ReactiveStreamsBackpressureStrategy backpressureStrategy, org.reactivestreams.Subscriber<? super org.apache.camel.Exchange> subscriber) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
protected void
protected void
discardBuffer
(List<org.apache.camel.Exchange> remaining) protected void
flush()
long
getId()
void
publish
(org.apache.camel.Exchange message) void
request
(long l) void
setBackpressureStrategy
(ReactiveStreamsBackpressureStrategy backpressureStrategy) void
-
Constructor Details
-
CamelSubscription
public CamelSubscription(String id, ExecutorService workerPool, CamelPublisher publisher, String streamName, ReactiveStreamsBackpressureStrategy backpressureStrategy, org.reactivestreams.Subscriber<? super org.apache.camel.Exchange> subscriber)
-
-
Method Details
-
request
public void request(long l) - Specified by:
request
in interfaceorg.reactivestreams.Subscription
-
checkAndFlush
protected void checkAndFlush() -
flush
protected void flush() -
signalCompletion
public void signalCompletion() -
cancel
public void cancel()- Specified by:
cancel
in interfaceorg.reactivestreams.Subscription
-
discardBuffer
-
publish
public void publish(org.apache.camel.Exchange message) -
setBackpressureStrategy
-
getBufferSize
public long getBufferSize() -
getBackpressureStrategy
-
getId
-