com.hazelcast.jet.pipeline

## Class JmsSourceBuilder

- java.lang.Object
- - com.hazelcast.jet.pipeline.JmsSourceBuilder

-     public final class JmsSourceBuilder
      extends Object

  See `Sources.jmsQueueBuilder(com.hazelcast.jet.function.DistributedSupplier<? extends javax.jms.ConnectionFactory>)` or `Sources.jmsTopicBuilder(com.hazelcast.jet.function.DistributedSupplier<? extends javax.jms.ConnectionFactory>)`.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `StreamSource<javax.jms.Message>` | `build()` Convenience for `build(DistributedFunction)`.
    `<T> StreamSource<T>` | `build(DistributedFunction<? super javax.jms.Message,? extends T> projectionFn)` Creates and returns the JMS `StreamSource` with the supplied components and the projection function `projectionFn`.
    `JmsSourceBuilder` | `connectionFn(DistributedFunction<? super javax.jms.ConnectionFactory,? extends javax.jms.Connection> connectionFn)` Sets the function which creates the connection from connection factory.
    `JmsSourceBuilder` | `connectionParams(String username, String password)` Sets the connection parameters.
    `JmsSourceBuilder` | `consumerFn(DistributedFunction<? super javax.jms.Session,? extends javax.jms.MessageConsumer> consumerFn)` Sets the function which creates the message consumer from session.
    `JmsSourceBuilder` | `destinationName(String destinationName)` Sets the name of the destination.
    `JmsSourceBuilder` | `flushFn(DistributedConsumer<? super javax.jms.Session> flushFn)` Sets the function which commits the session after consuming each message.
    `JmsSourceBuilder` | `sessionFn(DistributedFunction<? super javax.jms.Connection,? extends javax.jms.Session> sessionFn)` Sets the function which creates the session from connection.
    `JmsSourceBuilder` | `sessionParams(boolean transacted, int acknowledgeMode)` Sets the session parameters.

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

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

- - ### Method Detail

    - #### connectionParams

          public JmsSourceBuilder connectionParams(String username,
                                                   String password)

      Sets the connection parameters. If `connectionFn` is provided these parameters are ignored.
      Parameters:
        `username` - the username, Default value is `null`
        `password` - the password, Default value is `null`

    - #### connectionFn

          public JmsSourceBuilder connectionFn(@Nonnull
                                               DistributedFunction<? super javax.jms.ConnectionFactory,? extends javax.jms.Connection> connectionFn)

      Sets the function which creates the connection from connection factory.

      If not provided, the builder creates a function which uses `ConnectionFactory#createConnection(username, password)` to create the connection. See `connectionParams(String, String)`.

    - #### sessionParams

          public JmsSourceBuilder sessionParams(boolean transacted,
                                                int acknowledgeMode)

      Sets the session parameters. If `sessionFn` is provided these parameters are ignored.
      Parameters:
        `transacted` - if true marks the session as transacted false otherwise, Default value is false.
        `acknowledgeMode` - sets the acknowledge mode of the session, Default value is `Session.AUTO_ACKNOWLEDGE`

    - #### sessionFn

          public JmsSourceBuilder sessionFn(@Nonnull
                                            DistributedFunction<? super javax.jms.Connection,? extends javax.jms.Session> sessionFn)

      Sets the function which creates the session from connection.

      If not provided, the builder creates a function which uses `Connection#createSession(boolean transacted, int acknowledgeMode)` to create the session. See `sessionParams(boolean, int)`.

    - #### destinationName

          public JmsSourceBuilder destinationName(String destinationName)

      Sets the name of the destination. If `consumerFn` is provided this parameter is ignored.

    - #### consumerFn

          public JmsSourceBuilder consumerFn(@Nonnull
                                             DistributedFunction<? super javax.jms.Session,? extends javax.jms.MessageConsumer> consumerFn)

      Sets the function which creates the message consumer from session.

      If not provided, the builder creates a function which uses `Session#createConsumer(Destination destination)` to create the consumer. Either `consumerFn` or `destinationName` should be set. See `destinationName(String)`.

    - #### flushFn

          public JmsSourceBuilder flushFn(@Nonnull
                                          DistributedConsumer<? super javax.jms.Session> flushFn)

      Sets the function which commits the session after consuming each message.

      If not provided, the builder creates a no-op consumer.

    - #### build

          public <T> StreamSource<T> build(@Nonnull
                                           DistributedFunction<? super javax.jms.Message,? extends T> projectionFn)

      Creates and returns the JMS `StreamSource` with the supplied components and the projection function `projectionFn`.
      Type Parameters:
        `T` - the type of the items the source emits
      Parameters:
        `projectionFn` - the function which creates output object from each message

    - #### build

          public StreamSource<javax.jms.Message> build()

      Convenience for `build(DistributedFunction)`.

Copyright © 2018. All rights reserved.