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 void
cancel()
protected void
checkAndFlush()
protected void
discardBuffer(List<org.apache.camel.Exchange> remaining)
protected void
flush()
ReactiveStreamsBackpressureStrategy
getBackpressureStrategy()
long
getBufferSize()
String
getId()
void
publish(org.apache.camel.Exchange message)
void
request(long l)
void
setBackpressureStrategy(ReactiveStreamsBackpressureStrategy backpressureStrategy)
void
signalCompletion()
-
-
-
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:
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
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()
-
-