Class CamelSubscription
- java.lang.Object
-
- org.apache.camel.component.reactive.streams.engine.CamelSubscription
-
- All Implemented Interfaces:
org.reactivestreams.Subscription
public class CamelSubscription extends Object implements 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
Constructors Constructor Description CamelSubscription(String id, ExecutorService workerPool, CamelPublisher publisher, String streamName, ReactiveStreamsBackpressureStrategy backpressureStrategy, org.reactivestreams.Subscriber<? super org.apache.camel.Exchange> subscriber)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()protected voidcheckAndFlush()protected voiddiscardBuffer(List<org.apache.camel.Exchange> remaining)protected voidflush()ReactiveStreamsBackpressureStrategygetBackpressureStrategy()longgetBufferSize()StringgetId()voidpublish(org.apache.camel.Exchange message)voidrequest(long l)voidsetBackpressureStrategy(ReactiveStreamsBackpressureStrategy backpressureStrategy)voidsignalCompletion()
-
-
-
Constructor Detail
-
CamelSubscription
public CamelSubscription(String id, ExecutorService workerPool, CamelPublisher publisher, String streamName, ReactiveStreamsBackpressureStrategy backpressureStrategy, org.reactivestreams.Subscriber<? super org.apache.camel.Exchange> subscriber)
-
-
Method Detail
-
request
public void request(long l)
- Specified by:
requestin interfaceorg.reactivestreams.Subscription
-
checkAndFlush
protected void checkAndFlush()
-
flush
protected void flush()
-
signalCompletion
public void signalCompletion()
-
cancel
public void cancel()
- Specified by:
cancelin interfaceorg.reactivestreams.Subscription
-
discardBuffer
protected void discardBuffer(List<org.apache.camel.Exchange> remaining)
-
publish
public void publish(org.apache.camel.Exchange message)
-
setBackpressureStrategy
public void setBackpressureStrategy(ReactiveStreamsBackpressureStrategy backpressureStrategy)
-
getBufferSize
public long getBufferSize()
-
getBackpressureStrategy
public ReactiveStreamsBackpressureStrategy getBackpressureStrategy()
-
getId
public String getId()
-
-