Interface NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder

  • All Superinterfaces:
    org.apache.camel.builder.EndpointProducerBuilder, org.apache.camel.EndpointProducerResolver
    All Known Subinterfaces:
    NettyEndpointBuilderFactory.AdvancedNettyEndpointBuilder
    Enclosing interface:
    NettyEndpointBuilderFactory

    public static interface NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder
    extends org.apache.camel.builder.EndpointProducerBuilder
    Advanced builder for endpoint producers for the Netty component.
    • Method Detail

      • clientInitializerFactory

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder clientInitializerFactory​(Object clientInitializerFactory)
        To use a custom ClientInitializerFactory. The option is a: <code>org.apache.camel.component.netty.ClientInitializerFactory</code> type. Group: producer (advanced)
        Parameters:
        clientInitializerFactory - the value to set
        Returns:
        the dsl builder
      • clientInitializerFactory

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder clientInitializerFactory​(String clientInitializerFactory)
        To use a custom ClientInitializerFactory. The option will be converted to a <code>org.apache.camel.component.netty.ClientInitializerFactory</code> type. Group: producer (advanced)
        Parameters:
        clientInitializerFactory - the value to set
        Returns:
        the dsl builder
      • correlationManager

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder correlationManager​(Object correlationManager)
        To use a custom correlation manager to manage how request and reply messages are mapped when using request/reply with the netty producer. This should only be used if you have a way to map requests together with replies such as if there is correlation ids in both the request and reply messages. This can be used if you want to multiplex concurrent messages on the same channel (aka connection) in netty. When doing this you must have a way to correlate the request and reply messages so you can store the right reply on the inflight Camel Exchange before its continued routed. We recommend extending the TimeoutCorrelationManagerSupport when you build custom correlation managers. This provides support for timeout and other complexities you otherwise would need to implement as well. See also the producerPoolEnabled option for more details. The option is a: <code>org.apache.camel.component.netty.NettyCamelStateCorrelationManager</code> type. Group: producer (advanced)
        Parameters:
        correlationManager - the value to set
        Returns:
        the dsl builder
      • correlationManager

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder correlationManager​(String correlationManager)
        To use a custom correlation manager to manage how request and reply messages are mapped when using request/reply with the netty producer. This should only be used if you have a way to map requests together with replies such as if there is correlation ids in both the request and reply messages. This can be used if you want to multiplex concurrent messages on the same channel (aka connection) in netty. When doing this you must have a way to correlate the request and reply messages so you can store the right reply on the inflight Camel Exchange before its continued routed. We recommend extending the TimeoutCorrelationManagerSupport when you build custom correlation managers. This provides support for timeout and other complexities you otherwise would need to implement as well. See also the producerPoolEnabled option for more details. The option will be converted to a <code>org.apache.camel.component.netty.NettyCamelStateCorrelationManager</code> type. Group: producer (advanced)
        Parameters:
        correlationManager - the value to set
        Returns:
        the dsl builder
      • lazyChannelCreation

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder lazyChannelCreation​(boolean lazyChannelCreation)
        Channels can be lazily created to avoid exceptions, if the remote server is not up and running when the Camel producer is started. The option is a: <code>boolean</code> type. Default: true Group: producer (advanced)
        Parameters:
        lazyChannelCreation - the value to set
        Returns:
        the dsl builder
      • lazyChannelCreation

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder lazyChannelCreation​(String lazyChannelCreation)
        Channels can be lazily created to avoid exceptions, if the remote server is not up and running when the Camel producer is started. The option will be converted to a <code>boolean</code> type. Default: true Group: producer (advanced)
        Parameters:
        lazyChannelCreation - the value to set
        Returns:
        the dsl builder
      • producerPoolEnabled

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder producerPoolEnabled​(boolean producerPoolEnabled)
        Whether producer pool is enabled or not. Important: If you turn this off then a single shared connection is used for the producer, also if you are doing request/reply. That means there is a potential issue with interleaved responses if replies comes back out-of-order. Therefore you need to have a correlation id in both the request and reply messages so you can properly correlate the replies to the Camel callback that is responsible for continue processing the message in Camel. To do this you need to implement NettyCamelStateCorrelationManager as correlation manager and configure it via the correlationManager option. See also the correlationManager option for more details. The option is a: <code>boolean</code> type. Default: true Group: producer (advanced)
        Parameters:
        producerPoolEnabled - the value to set
        Returns:
        the dsl builder
      • producerPoolEnabled

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder producerPoolEnabled​(String producerPoolEnabled)
        Whether producer pool is enabled or not. Important: If you turn this off then a single shared connection is used for the producer, also if you are doing request/reply. That means there is a potential issue with interleaved responses if replies comes back out-of-order. Therefore you need to have a correlation id in both the request and reply messages so you can properly correlate the replies to the Camel callback that is responsible for continue processing the message in Camel. To do this you need to implement NettyCamelStateCorrelationManager as correlation manager and configure it via the correlationManager option. See also the correlationManager option for more details. The option will be converted to a <code>boolean</code> type. Default: true Group: producer (advanced)
        Parameters:
        producerPoolEnabled - the value to set
        Returns:
        the dsl builder
      • producerPoolMaxIdle

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder producerPoolMaxIdle​(int producerPoolMaxIdle)
        Sets the cap on the number of idle instances in the pool. The option is a: <code>int</code> type. Default: 100 Group: producer (advanced)
        Parameters:
        producerPoolMaxIdle - the value to set
        Returns:
        the dsl builder
      • producerPoolMaxIdle

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder producerPoolMaxIdle​(String producerPoolMaxIdle)
        Sets the cap on the number of idle instances in the pool. The option will be converted to a <code>int</code> type. Default: 100 Group: producer (advanced)
        Parameters:
        producerPoolMaxIdle - the value to set
        Returns:
        the dsl builder
      • producerPoolMaxTotal

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder producerPoolMaxTotal​(int producerPoolMaxTotal)
        Sets the cap on the number of objects that can be allocated by the pool (checked out to clients, or idle awaiting checkout) at a given time. Use a negative value for no limit. The option is a: <code>int</code> type. Default: -1 Group: producer (advanced)
        Parameters:
        producerPoolMaxTotal - the value to set
        Returns:
        the dsl builder
      • producerPoolMaxTotal

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder producerPoolMaxTotal​(String producerPoolMaxTotal)
        Sets the cap on the number of objects that can be allocated by the pool (checked out to clients, or idle awaiting checkout) at a given time. Use a negative value for no limit. The option will be converted to a <code>int</code> type. Default: -1 Group: producer (advanced)
        Parameters:
        producerPoolMaxTotal - the value to set
        Returns:
        the dsl builder
      • producerPoolMinEvictableIdle

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder producerPoolMinEvictableIdle​(long producerPoolMinEvictableIdle)
        Sets the minimum amount of time (value in millis) an object may sit idle in the pool before it is eligible for eviction by the idle object evictor. The option is a: <code>long</code> type. Default: 300000 Group: producer (advanced)
        Parameters:
        producerPoolMinEvictableIdle - the value to set
        Returns:
        the dsl builder
      • producerPoolMinEvictableIdle

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder producerPoolMinEvictableIdle​(String producerPoolMinEvictableIdle)
        Sets the minimum amount of time (value in millis) an object may sit idle in the pool before it is eligible for eviction by the idle object evictor. The option will be converted to a <code>long</code> type. Default: 300000 Group: producer (advanced)
        Parameters:
        producerPoolMinEvictableIdle - the value to set
        Returns:
        the dsl builder
      • producerPoolMinIdle

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder producerPoolMinIdle​(int producerPoolMinIdle)
        Sets the minimum number of instances allowed in the producer pool before the evictor thread (if active) spawns new objects. The option is a: <code>int</code> type. Group: producer (advanced)
        Parameters:
        producerPoolMinIdle - the value to set
        Returns:
        the dsl builder
      • producerPoolMinIdle

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder producerPoolMinIdle​(String producerPoolMinIdle)
        Sets the minimum number of instances allowed in the producer pool before the evictor thread (if active) spawns new objects. The option will be converted to a <code>int</code> type. Group: producer (advanced)
        Parameters:
        producerPoolMinIdle - the value to set
        Returns:
        the dsl builder
      • udpConnectionlessSending

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder udpConnectionlessSending​(boolean udpConnectionlessSending)
        This option supports connection less udp sending which is a real fire and forget. A connected udp send receive the PortUnreachableException if no one is listen on the receiving port. The option is a: <code>boolean</code> type. Default: false Group: producer (advanced)
        Parameters:
        udpConnectionlessSending - the value to set
        Returns:
        the dsl builder
      • udpConnectionlessSending

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder udpConnectionlessSending​(String udpConnectionlessSending)
        This option supports connection less udp sending which is a real fire and forget. A connected udp send receive the PortUnreachableException if no one is listen on the receiving port. The option will be converted to a <code>boolean</code> type. Default: false Group: producer (advanced)
        Parameters:
        udpConnectionlessSending - the value to set
        Returns:
        the dsl builder
      • useByteBuf

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder useByteBuf​(boolean useByteBuf)
        If the useByteBuf is true, netty producer will turn the message body into ByteBuf before sending it out. The option is a: <code>boolean</code> type. Default: false Group: producer (advanced)
        Parameters:
        useByteBuf - the value to set
        Returns:
        the dsl builder
      • useByteBuf

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder useByteBuf​(String useByteBuf)
        If the useByteBuf is true, netty producer will turn the message body into ByteBuf before sending it out. The option will be converted to a <code>boolean</code> type. Default: false Group: producer (advanced)
        Parameters:
        useByteBuf - the value to set
        Returns:
        the dsl builder
      • allowSerializedHeaders

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder allowSerializedHeaders​(boolean allowSerializedHeaders)
        Only used for TCP when transferExchange is true. When set to true, serializable objects in headers and properties will be added to the exchange. Otherwise Camel will exclude any non-serializable objects and log it at WARN level. The option is a: <code>boolean</code> type. Default: false Group: advanced
        Parameters:
        allowSerializedHeaders - the value to set
        Returns:
        the dsl builder
      • allowSerializedHeaders

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder allowSerializedHeaders​(String allowSerializedHeaders)
        Only used for TCP when transferExchange is true. When set to true, serializable objects in headers and properties will be added to the exchange. Otherwise Camel will exclude any non-serializable objects and log it at WARN level. The option will be converted to a <code>boolean</code> type. Default: false Group: advanced
        Parameters:
        allowSerializedHeaders - the value to set
        Returns:
        the dsl builder
      • nativeTransport

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder nativeTransport​(boolean nativeTransport)
        Whether to use native transport instead of NIO. Native transport takes advantage of the host operating system and is only supported on some platforms. You need to add the netty JAR for the host operating system you are using. See more details at: http://netty.io/wiki/native-transports.html. The option is a: <code>boolean</code> type. Default: false Group: advanced
        Parameters:
        nativeTransport - the value to set
        Returns:
        the dsl builder
      • nativeTransport

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder nativeTransport​(String nativeTransport)
        Whether to use native transport instead of NIO. Native transport takes advantage of the host operating system and is only supported on some platforms. You need to add the netty JAR for the host operating system you are using. See more details at: http://netty.io/wiki/native-transports.html. The option will be converted to a <code>boolean</code> type. Default: false Group: advanced
        Parameters:
        nativeTransport - the value to set
        Returns:
        the dsl builder
      • options

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder options​(String key,
                                                                                         Object value)
        Allows to configure additional netty options using option. as prefix. For example option.child.keepAlive=false to set the netty option child.keepAlive=false. See the Netty documentation for possible options that can be used. The option is a: <code>java.util.Map&lt;java.lang.String, java.lang.Object&gt;</code> type. The option is multivalued, and you can use the options(String, Object) method to add a value (call the method multiple times to set more values). Group: advanced
        Parameters:
        key - the option key
        value - the option value
        Returns:
        the dsl builder
      • options

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder options​(Map values)
        Allows to configure additional netty options using option. as prefix. For example option.child.keepAlive=false to set the netty option child.keepAlive=false. See the Netty documentation for possible options that can be used. The option is a: <code>java.util.Map&lt;java.lang.String, java.lang.Object&gt;</code> type. The option is multivalued, and you can use the options(String, Object) method to add a value (call the method multiple times to set more values). Group: advanced
        Parameters:
        values - the values
        Returns:
        the dsl builder
      • receiveBufferSize

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder receiveBufferSize​(int receiveBufferSize)
        The TCP/UDP buffer sizes to be used during inbound communication. Size is bytes. The option is a: <code>int</code> type. Default: 65536 Group: advanced
        Parameters:
        receiveBufferSize - the value to set
        Returns:
        the dsl builder
      • receiveBufferSize

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder receiveBufferSize​(String receiveBufferSize)
        The TCP/UDP buffer sizes to be used during inbound communication. Size is bytes. The option will be converted to a <code>int</code> type. Default: 65536 Group: advanced
        Parameters:
        receiveBufferSize - the value to set
        Returns:
        the dsl builder
      • receiveBufferSizePredictor

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder receiveBufferSizePredictor​(int receiveBufferSizePredictor)
        Configures the buffer size predictor. See details at Jetty documentation and this mail thread. The option is a: <code>int</code> type. Group: advanced
        Parameters:
        receiveBufferSizePredictor - the value to set
        Returns:
        the dsl builder
      • receiveBufferSizePredictor

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder receiveBufferSizePredictor​(String receiveBufferSizePredictor)
        Configures the buffer size predictor. See details at Jetty documentation and this mail thread. The option will be converted to a <code>int</code> type. Group: advanced
        Parameters:
        receiveBufferSizePredictor - the value to set
        Returns:
        the dsl builder
      • sendBufferSize

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder sendBufferSize​(int sendBufferSize)
        The TCP/UDP buffer sizes to be used during outbound communication. Size is bytes. The option is a: <code>int</code> type. Default: 65536 Group: advanced
        Parameters:
        sendBufferSize - the value to set
        Returns:
        the dsl builder
      • sendBufferSize

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder sendBufferSize​(String sendBufferSize)
        The TCP/UDP buffer sizes to be used during outbound communication. Size is bytes. The option will be converted to a <code>int</code> type. Default: 65536 Group: advanced
        Parameters:
        sendBufferSize - the value to set
        Returns:
        the dsl builder
      • synchronous

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder synchronous​(boolean synchronous)
        Sets whether synchronous processing should be strictly used. The option is a: <code>boolean</code> type. Default: false Group: advanced
        Parameters:
        synchronous - the value to set
        Returns:
        the dsl builder
      • transferExchange

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder transferExchange​(boolean transferExchange)
        Only used for TCP. You can transfer the exchange over the wire instead of just the body. The following fields are transferred: In body, Out body, fault body, In headers, Out headers, fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. The option is a: <code>boolean</code> type. Default: false Group: advanced
        Parameters:
        transferExchange - the value to set
        Returns:
        the dsl builder
      • transferExchange

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder transferExchange​(String transferExchange)
        Only used for TCP. You can transfer the exchange over the wire instead of just the body. The following fields are transferred: In body, Out body, fault body, In headers, Out headers, fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. The option will be converted to a <code>boolean</code> type. Default: false Group: advanced
        Parameters:
        transferExchange - the value to set
        Returns:
        the dsl builder
      • udpByteArrayCodec

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder udpByteArrayCodec​(boolean udpByteArrayCodec)
        For UDP only. If enabled the using byte array codec instead of Java serialization protocol. The option is a: <code>boolean</code> type. Default: false Group: advanced
        Parameters:
        udpByteArrayCodec - the value to set
        Returns:
        the dsl builder
      • udpByteArrayCodec

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder udpByteArrayCodec​(String udpByteArrayCodec)
        For UDP only. If enabled the using byte array codec instead of Java serialization protocol. The option will be converted to a <code>boolean</code> type. Default: false Group: advanced
        Parameters:
        udpByteArrayCodec - the value to set
        Returns:
        the dsl builder
      • workerCount

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder workerCount​(int workerCount)
        When netty works on nio mode, it uses default workerCount parameter from Netty (which is cpu_core_threads x 2). User can use this option to override the default workerCount from Netty. The option is a: <code>int</code> type. Group: advanced
        Parameters:
        workerCount - the value to set
        Returns:
        the dsl builder
      • workerCount

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder workerCount​(String workerCount)
        When netty works on nio mode, it uses default workerCount parameter from Netty (which is cpu_core_threads x 2). User can use this option to override the default workerCount from Netty. The option will be converted to a <code>int</code> type. Group: advanced
        Parameters:
        workerCount - the value to set
        Returns:
        the dsl builder
      • workerGroup

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder workerGroup​(Object workerGroup)
        To use a explicit EventLoopGroup as the boss thread pool. For example to share a thread pool with multiple consumers or producers. By default each consumer or producer has their own worker pool with 2 x cpu count core threads. The option is a: <code>io.netty.channel.EventLoopGroup</code> type. Group: advanced
        Parameters:
        workerGroup - the value to set
        Returns:
        the dsl builder
      • workerGroup

        default NettyEndpointBuilderFactory.AdvancedNettyEndpointProducerBuilder workerGroup​(String workerGroup)
        To use a explicit EventLoopGroup as the boss thread pool. For example to share a thread pool with multiple consumers or producers. By default each consumer or producer has their own worker pool with 2 x cpu count core threads. The option will be converted to a <code>io.netty.channel.EventLoopGroup</code> type. Group: advanced
        Parameters:
        workerGroup - the value to set
        Returns:
        the dsl builder