Package com.hazelcast.jet.pipeline
Class JmsSinkBuilder<T>
- java.lang.Object
-
- com.hazelcast.jet.pipeline.JmsSinkBuilder<T>
-
- Type Parameters:
T
- type of the items the sink accepts
public final class JmsSinkBuilder<T> extends java.lang.Object
SeeSinks.jmsQueueBuilder(com.hazelcast.function.SupplierEx<jakarta.jms.ConnectionFactory>)
orSinks.jmsTopicBuilder(com.hazelcast.function.SupplierEx<jakarta.jms.ConnectionFactory>)
.- Since:
- Jet 3.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Sink<T>
build()
Creates and returns the JMSSink
with the supplied components.JmsSinkBuilder<T>
connectionFn(FunctionEx<jakarta.jms.ConnectionFactory,jakarta.jms.Connection> connectionFn)
Sets the function which creates a connection given a connection factory.JmsSinkBuilder<T>
connectionParams(java.lang.String username, java.lang.String password)
Sets the connection parameters.JmsSinkBuilder<T>
destinationName(java.lang.String destinationName)
Sets the name of the destination.JmsSinkBuilder<T>
exactlyOnce(boolean enable)
Enables or disables the exactly-once behavior of the sink using two-phase commit of state snapshots.JmsSinkBuilder<T>
messageFn(BiFunctionEx<jakarta.jms.Session,T,jakarta.jms.Message> messageFn)
Sets the function which creates the message from the item.
-
-
-
Method Detail
-
connectionParams
@Nonnull public JmsSinkBuilder<T> connectionParams(@Nullable java.lang.String username, @Nullable java.lang.String password)
Sets the connection parameters. IfconnectionFn
is provided, these parameters are ignored.- Parameters:
username
- the username, Default value isnull
password
- the password, Default value isnull
-
connectionFn
@Nonnull public JmsSinkBuilder<T> connectionFn(@Nullable FunctionEx<jakarta.jms.ConnectionFactory,jakarta.jms.Connection> connectionFn)
Sets the function which creates a connection given a connection factory.If not provided, the following will be used:
The given function must be stateless.if (factory instanceof XAConnectionFactory) { XAConnectionFactory xaFactory = (XAConnectionFactory) factory; return usernameLocal != null || passwordLocal != null ? xaFactory.createXAConnection(usernameLocal, passwordLocal) : xaFactory.createXAConnection(); } else { return usernameLocal != null || passwordLocal != null ? factory.createConnection(usernameLocal, passwordLocal) : factory.createConnection(); }
-
destinationName
@Nonnull public JmsSinkBuilder<T> destinationName(@Nonnull java.lang.String destinationName)
Sets the name of the destination.
-
messageFn
@Nonnull public JmsSinkBuilder<T> messageFn(@Nullable BiFunctionEx<jakarta.jms.Session,T,jakarta.jms.Message> messageFn)
Sets the function which creates the message from the item.If not provided, the builder creates a function which wraps
item.toString()
into aTextMessage
, unless the item is already an instance ofjavax.jms.Message
.The given function must be stateless.
-
exactlyOnce
@Nonnull public JmsSinkBuilder<T> exactlyOnce(boolean enable)
Enables or disables the exactly-once behavior of the sink using two-phase commit of state snapshots. If enabled, the processing guarantee of the job must be set to exactly-once, otherwise the sink's guarantee will match that of the job. In other words, sink's guarantee cannot be higher than job's, but can be lower to avoid the additional overhead.The default value is true.
- Parameters:
enable
- If true, sink's guarantee will match the job guarantee. If false, sink's guarantee will be at-least-once even if job's is exactly-once- Returns:
- this instance for fluent API
-
-