org.apache.ignite.stream.camel

## Class CamelStreamer<K,V>

- java.lang.Object
- - org.apache.ignite.stream.StreamAdapter<org.apache.camel.Exchange,K,V>
  - - org.apache.ignite.stream.camel.CamelStreamer<K,V>

- All Implemented Interfaces:
    org.apache.camel.Processor

      public class CamelStreamer<K,V>
      extends StreamAdapter<org.apache.camel.Exchange,K,V>
      implements org.apache.camel.Processor

  This streamer consumes messages from an Apache Camel consumer endpoint and feeds them into an Ignite data streamer. The only mandatory properties are `endpointUri` and the appropriate stream tuple extractor (either `StreamSingleTupleExtractor` or `StreamMultipleTupleExtractor`. The user can also provide a custom `CamelContext` in case they want to attach custom components, a `PropertiesComponent`, set tracers, management strategies, etc.
  See Also:
    Apache Camel, Apache Camel components

- - ### Field Summary

    - ### Fields inherited from class org.apache.ignite.stream.StreamAdapter

      `ignite`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CamelStreamer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.apache.camel.CamelContext` | `getCamelContext()` Gets the underlying `CamelContext`, whether created automatically by Ignite or the context specified by the user.
    `String` | `getEndpointUri()` Gets the endpoint URI from which to consume.
    `org.apache.camel.Processor` | `getResponseProcessor()` Gets the `Processor` used to generate the response.
    `void` | `process(org.apache.camel.Exchange exchange)` Processes the incoming `Exchange` and adds the tuple(s) to the underlying streamer.
    `void` | `setCamelContext(org.apache.camel.CamelContext camelCtx)` Explicitly sets the `CamelContext` to use.
    `void` | `setEndpointUri(String endpointUri)` Sets the endpoint URI from which to consume.
    `void` | `setResponseProcessor(org.apache.camel.Processor resProc)` Sets the `Processor` used to generate the response.
    `void` | `start()` Starts the streamer.
    `void` | `stop()` Stops the streamer.

    - ### Methods inherited from class org.apache.ignite.stream.StreamAdapter

      `addMessage, getIgnite, getMultipleTupleExtractor, getSingleTupleExtractor, getStreamer, getTupleExtractor, setIgnite, setMultipleTupleExtractor, setSingleTupleExtractor, setStreamer, setTupleExtractor`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CamelStreamer

          public CamelStreamer()

  - ### Method Detail

    - #### start

          public void start()
                     throws IgniteException

      Starts the streamer.
      Throws:
        `IgniteException` - In cases when failed to start the streamer.

    - #### stop

          public void stop()
                    throws IgniteException

      Stops the streamer.
      Throws:
        `IgniteException` - In cases if failed to stop the streamer.

    - #### process

          public void process(org.apache.camel.Exchange exchange)
                       throws Exception

      Processes the incoming `Exchange` and adds the tuple(s) to the underlying streamer.
      Specified by:
        `process` in interface `org.apache.camel.Processor`
      Parameters:
        `exchange` - The Camel Exchange.
      Throws:
        `Exception`

    - #### getCamelContext

          public org.apache.camel.CamelContext getCamelContext()

      Gets the underlying `CamelContext`, whether created automatically by Ignite or the context specified by the user.
      Returns:
        The Camel Context.

    - #### setCamelContext

          public void setCamelContext(org.apache.camel.CamelContext camelCtx)

      Explicitly sets the `CamelContext` to use. Doing so gives the user the opportunity to attach custom components, a `PropertiesComponent`, set tracers, management strategies, etc.
      Parameters:
        `camelCtx` - The Camel Context to use. In most cases, an instance of `DefaultCamelContext`.

    - #### getEndpointUri

          public String getEndpointUri()

      Gets the endpoint URI from which to consume.
      Returns:
        The endpoint URI.

    - #### setEndpointUri

          public void setEndpointUri(String endpointUri)

      Sets the endpoint URI from which to consume. Mandatory.
      Parameters:
        `endpointUri` - The endpoint URI.

    - #### getResponseProcessor

          public org.apache.camel.Processor getResponseProcessor()

      Gets the `Processor` used to generate the response.
      Returns:
        The `Processor`.

    - #### setResponseProcessor

          public void setResponseProcessor(org.apache.camel.Processor resProc)

      Sets the `Processor` used to generate the response.
      Parameters:
        `resProc` - The `Processor`.

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020