@ManagedResource(description="Managed CamelReactiveStreamsService") public class DefaultCamelReactiveStreamsService extends org.apache.camel.support.service.ServiceSupport implements CamelReactiveStreamsService
| Constructor and Description |
|---|
DefaultCamelReactiveStreamsService(org.apache.camel.CamelContext context,
ReactiveStreamsEngineConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
ReactiveStreamsCamelSubscriber |
attachCamelConsumer(String name,
ReactiveStreamsConsumer consumer)
Used by Camel to associate the subscriber of the stream with the given name to a specific Camel consumer.
|
void |
attachCamelProducer(String name,
ReactiveStreamsProducer producer)
Used by Camel to associate the publisher of the stream with the given name to a specific Camel producer.
|
TabularData |
camelPublishers() |
TabularData |
camelSubscribers() |
void |
detachCamelConsumer(String name)
Used by Camel to detach the existing consumer from the given stream.
|
void |
detachCamelProducer(String name)
Used by Camel to detach the existing producer from the given stream.
|
protected void |
doInit() |
protected org.reactivestreams.Publisher<org.apache.camel.Exchange> |
doRequest(String name,
org.apache.camel.Exchange data) |
protected void |
doStart() |
protected void |
doStop() |
org.reactivestreams.Publisher<org.apache.camel.Exchange> |
from(String uri)
Creates a new stream from the endpoint URI (used as Camel Consumer) and returns the associated
Publisher. |
<T> org.reactivestreams.Publisher<T> |
from(String uri,
Class<T> type)
Creates a new stream of the given type from the endpoint URI (used as Camel Consumer) and returns the associated
Publisher. |
org.reactivestreams.Publisher<org.apache.camel.Exchange> |
fromStream(String name)
Returns the publisher associated to the given stream name.
|
<T> org.reactivestreams.Publisher<T> |
fromStream(String name,
Class<T> cls)
Returns the publisher associated to the given stream name.
|
org.apache.camel.CamelContext |
getCamelContext() |
String |
getId() |
<T> void |
process(String uri,
Class<T> type,
Function<? super org.reactivestreams.Publisher<T>,?> processor)
Adds a processing step at the specified endpoint uri (usually a "direct:name") that delegates to the given
reactive processor.
|
void |
process(String uri,
Function<? super org.reactivestreams.Publisher<org.apache.camel.Exchange>,?> processor)
Adds a processing step at the specified endpoint uri (usually a "direct:name") that delegates to the given
reactive processor.
|
void |
sendCamelExchange(String name,
org.apache.camel.Exchange exchange)
Used by Camel to send the exchange to all active subscriptions on the given stream.
|
ReactiveStreamsCamelSubscriber |
streamSubscriber(String name)
Returns the subscriber associated to the given stream name.
|
<T> org.reactivestreams.Subscriber<T> |
streamSubscriber(String name,
Class<T> type)
Returns the subscriber associated to the given stream name.
|
org.reactivestreams.Subscriber<org.apache.camel.Exchange> |
subscriber(String uri)
Creates a new route that pushes data to the endpoint URI and returns the associated
Subscriber. |
<T> org.reactivestreams.Subscriber<T> |
subscriber(String uri,
Class<T> type)
Creates a new route that pushes data to the endpoint URI and returns the associated
Subscriber. |
Function<Object,org.reactivestreams.Publisher<org.apache.camel.Exchange>> |
to(String uri)
Creates a new route that uses the endpoint URI as producer, and returns a function that pushes the data into the
route and returns the
Publisher that holds the resulting exchange or the error. |
<T> Function<Object,org.reactivestreams.Publisher<T>> |
to(String uri,
Class<T> type)
Creates a new route that uses the endpoint URI as producer, and returns a function that pushes the data into the
route and returns the
Publisher that holds the exchange output or an error. |
org.reactivestreams.Publisher<org.apache.camel.Exchange> |
to(String uri,
Object data)
Creates a new route that uses the endpoint URI as producer, pushes the given data to the route and returns a
Publisher that will eventually return the resulting exchange or an error. |
<T> org.reactivestreams.Publisher<T> |
to(String uri,
Object data,
Class<T> type)
Creates a new route that uses the endpoint URI as producer, pushes the given data to the route and returns a
Publisher that will eventually return the exchange output or an error. |
Function<?,? extends org.reactivestreams.Publisher<org.apache.camel.Exchange>> |
toStream(String name)
Returns a function that pushes data into the specified Camel stream and returns a Publisher (mono) holding the
resulting exchange or an error.
|
<T> Function<Object,org.reactivestreams.Publisher<T>> |
toStream(String name,
Class<T> type)
Returns a function that pushes data into the specified Camel stream and returns a Publisher (mono) holding the
exchange output or an error.
|
org.reactivestreams.Publisher<org.apache.camel.Exchange> |
toStream(String name,
Object data)
Pushes the given data into the specified Camel stream and returns a Publisher (mono) holding the resulting
exchange or an error.
|
<T> org.reactivestreams.Publisher<T> |
toStream(String name,
Object data,
Class<T> type)
Pushes the given data into the specified Camel stream and returns a Publisher (mono) holding the exchange output
or an error.
|
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, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic DefaultCamelReactiveStreamsService(org.apache.camel.CamelContext context,
ReactiveStreamsEngineConfiguration configuration)
public String getId()
getId in interface org.apache.camel.spi.HasIdpublic org.apache.camel.CamelContext getCamelContext()
getCamelContext in interface org.apache.camel.spi.HasCamelContextprotected void doInit()
doInit in class org.apache.camel.support.service.BaseServiceprotected void doStart()
throws Exception
doStart in class org.apache.camel.support.service.BaseServiceExceptionprotected void doStop()
throws Exception
doStop in class org.apache.camel.support.service.BaseServiceExceptionpublic org.reactivestreams.Publisher<org.apache.camel.Exchange> fromStream(String name)
CamelReactiveStreamsServicefromStream in interface CamelReactiveStreamsServicename - the stream namepublic <T> org.reactivestreams.Publisher<T> fromStream(String name, Class<T> cls)
CamelReactiveStreamsServicefromStream in interface CamelReactiveStreamsServiceT - the type of items emitted by the publishername - the stream namecls - the type of the emitted itemspublic ReactiveStreamsCamelSubscriber streamSubscriber(String name)
CamelReactiveStreamsServicestreamSubscriber in interface CamelReactiveStreamsServicename - the stream namepublic <T> org.reactivestreams.Subscriber<T> streamSubscriber(String name, Class<T> type)
CamelReactiveStreamsServicestreamSubscriber in interface CamelReactiveStreamsServiceT - the type of items accepted by the subscribername - the stream nametype - the publisher converts automatically exchanges to the given type.public void sendCamelExchange(String name, org.apache.camel.Exchange exchange)
CamelReactiveStreamsServicesendCamelExchange in interface CamelReactiveStreamsServicename - the stream nameexchange - the exchange to be forwarded to the external subscriberspublic org.reactivestreams.Publisher<org.apache.camel.Exchange> toStream(String name, Object data)
CamelReactiveStreamsServicetoStream in interface CamelReactiveStreamsServicename - the stream namedata - the data to pushpublic Function<?,? extends org.reactivestreams.Publisher<org.apache.camel.Exchange>> toStream(String name)
CamelReactiveStreamsServiceCamelReactiveStreamsService.toStream(String, Object).toStream in interface CamelReactiveStreamsServicename - the stream namepublic <T> org.reactivestreams.Publisher<T> toStream(String name, Object data, Class<T> type)
CamelReactiveStreamsServicetoStream in interface CamelReactiveStreamsServiceT - the generic type of the resulting Publishername - the stream namedata - the data to pushtype - the type to which the output should be convertedprotected org.reactivestreams.Publisher<org.apache.camel.Exchange> doRequest(String name, org.apache.camel.Exchange data)
public <T> Function<Object,org.reactivestreams.Publisher<T>> toStream(String name, Class<T> type)
CamelReactiveStreamsServiceCamelReactiveStreamsService.toStream(String, Object, Class).toStream in interface CamelReactiveStreamsServiceT - the generic type of the resulting Publishername - the stream nametype - the type to which the output should be convertedpublic org.reactivestreams.Publisher<org.apache.camel.Exchange> from(String uri)
CamelReactiveStreamsServicePublisher.
If a stream has already been created, the existing Publisher is returned.from in interface CamelReactiveStreamsServiceuri - the consumer uripublic <T> org.reactivestreams.Publisher<T> from(String uri, Class<T> type)
CamelReactiveStreamsServicePublisher.
If a stream has already been created, the existing Publisher is returned.from in interface CamelReactiveStreamsServiceT - the type to which Camel should convert exchanges touri - the consumer uritype - the type of items emitted by the publisherpublic org.reactivestreams.Subscriber<org.apache.camel.Exchange> subscriber(String uri)
CamelReactiveStreamsServiceSubscriber.
This method always create a new stream.subscriber in interface CamelReactiveStreamsServiceuri - the target uripublic <T> org.reactivestreams.Subscriber<T> subscriber(String uri, Class<T> type)
CamelReactiveStreamsServiceSubscriber.
This method always create a new stream.subscriber in interface CamelReactiveStreamsServiceT - the type from which Camel should convert data to exchangesuri - the target uritype - the type of items that the subscriber can receivepublic org.reactivestreams.Publisher<org.apache.camel.Exchange> to(String uri, Object data)
CamelReactiveStreamsServicePublisher that will eventually return the resulting exchange or an error.to in interface CamelReactiveStreamsServiceuri - the producer uridata - the data to pushpublic Function<Object,org.reactivestreams.Publisher<org.apache.camel.Exchange>> to(String uri)
CamelReactiveStreamsServicePublisher that holds the resulting exchange or the error.
This is a curryied version of CamelReactiveStreamsService.to(String, Object).to in interface CamelReactiveStreamsServiceuri - the producer uripublic <T> org.reactivestreams.Publisher<T> to(String uri, Object data, Class<T> type)
CamelReactiveStreamsServicePublisher that will eventually return the exchange output or an error.to in interface CamelReactiveStreamsServiceT - the generic type of the resulting Publisheruri - the producer uridata - the data to pushtype - the type to which the output should be convertedpublic <T> Function<Object,org.reactivestreams.Publisher<T>> to(String uri, Class<T> type)
CamelReactiveStreamsServicePublisher that holds the exchange output or an error.
This is a curryied version of CamelReactiveStreamsService.to(String, Object, Class).to in interface CamelReactiveStreamsServiceT - the generic type of the resulting Publisheruri - the producer uritype - the type to which the output should be convertedpublic void process(String uri, Function<? super org.reactivestreams.Publisher<org.apache.camel.Exchange>,?> processor)
CamelReactiveStreamsServicePublisher of exchanges and returns an object. If the output of the processor is
a Publisher, it will be unwrapped before delivering the result to the source route.process in interface CamelReactiveStreamsServiceuri - the uri where the processor should be attachedprocessor - the reactive processorpublic <T> void process(String uri, Class<T> type, Function<? super org.reactivestreams.Publisher<T>,?> processor)
CamelReactiveStreamsServicePublisher of items of the given type and returns an object. If the output of the
processor is a Publisher, it will be unwrapped before delivering the result to the source route.process in interface CamelReactiveStreamsServiceT - the generic type of the Publisher that should be processeduri - the uri where the processor should be attachedtype - the type to which the body of the exchange should be convertedprocessor - the reactive processorpublic ReactiveStreamsCamelSubscriber attachCamelConsumer(String name, ReactiveStreamsConsumer consumer)
CamelReactiveStreamsServiceattachCamelConsumer in interface CamelReactiveStreamsServicename - the stream nameconsumer - the consumer of the routepublic void detachCamelConsumer(String name)
CamelReactiveStreamsServicedetachCamelConsumer in interface CamelReactiveStreamsServicename - the stream namepublic void attachCamelProducer(String name, ReactiveStreamsProducer producer)
CamelReactiveStreamsServiceattachCamelProducer in interface CamelReactiveStreamsServicename - the stream nameproducer - the producer of the routepublic void detachCamelProducer(String name)
CamelReactiveStreamsServicedetachCamelProducer in interface CamelReactiveStreamsServicename - the stream name@ManagedOperation(description="Information about Camel Reactive subscribers") public TabularData camelSubscribers()
@ManagedOperation(description="Information about Camel Reactive publishers") public TabularData camelPublishers()
Apache Camel