Class ReactiveStreamsEndpoint
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultEndpoint
-
- org.apache.camel.component.reactive.streams.ReactiveStreamsEndpoint
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Endpoint
,org.apache.camel.IsSingleton
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.HasId
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="2.19.0", scheme="reactive-streams", title="Reactive Streams", syntax="reactive-streams:stream", category={REACTIVE,STREAMS}) @ManagedResource(description="Managed ReactiveStreamsEndpoint") public class ReactiveStreamsEndpoint extends org.apache.camel.support.DefaultEndpoint
Exchange messages with reactive stream processing libraries compatible with the reactive streams standard.
-
-
Constructor Summary
Constructors Constructor Description ReactiveStreamsEndpoint(String endpointUri, ReactiveStreamsComponent component)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.camel.Consumer
createConsumer(org.apache.camel.Processor processor)
org.apache.camel.Producer
createProducer()
ReactiveStreamsBackpressureStrategy
getBackpressureStrategy()
int
getConcurrentConsumers()
double
getExchangesRefillLowWatermark()
Integer
getMaxInflightExchanges()
String
getStream()
boolean
isForwardOnComplete()
boolean
isForwardOnError()
void
setBackpressureStrategy(ReactiveStreamsBackpressureStrategy backpressureStrategy)
The backpressure strategy to use when pushing events to a slow subscriber.void
setConcurrentConsumers(int concurrentConsumers)
Number of threads used to process exchanges in the Camel route.void
setExchangesRefillLowWatermark(double exchangesRefillLowWatermark)
Set the low watermark of requested exchanges to the active subscription as percentage of the maxInflightExchanges.void
setForwardOnComplete(boolean forwardOnComplete)
Determines if onComplete events should be pushed to the Camel route.void
setForwardOnError(boolean forwardOnError)
Determines if onError events should be pushed to the Camel route.void
setMaxInflightExchanges(Integer maxInflightExchanges)
Maximum number of exchanges concurrently being processed by Camel.void
setStream(String stream)
Name of the stream channel used by the endpoint to exchange messages.-
Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, doStart, doStop, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
ReactiveStreamsEndpoint
public ReactiveStreamsEndpoint(String endpointUri, ReactiveStreamsComponent component)
-
-
Method Detail
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
- Throws:
Exception
-
getStream
@ManagedAttribute(description="Name of the stream channel used by the endpoint to exchange messages") public String getStream()
-
setStream
public void setStream(String stream)
Name of the stream channel used by the endpoint to exchange messages.
-
getMaxInflightExchanges
@ManagedAttribute(description="Maximum number of exchanges concurrently being processed by Camel") public Integer getMaxInflightExchanges()
-
setMaxInflightExchanges
public void setMaxInflightExchanges(Integer maxInflightExchanges)
Maximum number of exchanges concurrently being processed by Camel. This parameter controls backpressure on the stream. Setting a non-positive value will disable backpressure.
-
getConcurrentConsumers
public int getConcurrentConsumers()
-
setConcurrentConsumers
@ManagedAttribute(description="Number of threads used to process exchanges in the Camel route") public void setConcurrentConsumers(int concurrentConsumers)
Number of threads used to process exchanges in the Camel route.
-
getBackpressureStrategy
public ReactiveStreamsBackpressureStrategy getBackpressureStrategy()
-
setBackpressureStrategy
public void setBackpressureStrategy(ReactiveStreamsBackpressureStrategy backpressureStrategy)
The backpressure strategy to use when pushing events to a slow subscriber.
-
isForwardOnComplete
@ManagedAttribute(description="Determines if onComplete events should be pushed to the Camel route") public boolean isForwardOnComplete()
-
setForwardOnComplete
public void setForwardOnComplete(boolean forwardOnComplete)
Determines if onComplete events should be pushed to the Camel route.
-
isForwardOnError
@ManagedAttribute(description="Determines if onError events should be pushed to the Camel route") public boolean isForwardOnError()
-
setForwardOnError
public void setForwardOnError(boolean forwardOnError)
Determines if onError events should be pushed to the Camel route. Exceptions will be set as message body.
-
getExchangesRefillLowWatermark
@ManagedAttribute(description="The percentage of maxInflightExchanges below which new items can be requested to the source subscription") public double getExchangesRefillLowWatermark()
-
setExchangesRefillLowWatermark
public void setExchangesRefillLowWatermark(double exchangesRefillLowWatermark)
Set the low watermark of requested exchanges to the active subscription as percentage of the maxInflightExchanges. When the number of pending items from the upstream source is lower than the watermark, new items can be requested to the subscription. If set to 0, the subscriber will request items in batches of maxInflightExchanges, only after all items of the previous batch have been processed. If set to 1, the subscriber can request a new item each time an exchange is processed (chatty). Any intermediate value can be used.
-
-