T
- type of the items the sink acceptspublic final class JmsSinkBuilder<T> extends Object
Sinks.jmsQueueBuilder(com.hazelcast.jet.function.SupplierEx<javax.jms.ConnectionFactory>)
or Sinks.jmsTopicBuilder(com.hazelcast.jet.function.SupplierEx<javax.jms.ConnectionFactory>)
.Modifier and Type | Method and Description |
---|---|
Sink<T> |
build()
Creates and returns the JMS
Sink with the supplied components. |
JmsSinkBuilder<T> |
connectionFn(FunctionEx<javax.jms.ConnectionFactory,javax.jms.Connection> connectionFn)
Sets the function which creates the connection from connection factory.
|
JmsSinkBuilder<T> |
connectionParams(String username,
String password)
Sets the connection parameters.
|
JmsSinkBuilder<T> |
destinationName(String destinationName)
Sets the name of the destination.
|
JmsSinkBuilder<T> |
flushFn(ConsumerEx<javax.jms.Session> flushFn)
Sets the function which flushes the session after a batch of messages is
sent.
|
JmsSinkBuilder<T> |
messageFn(BiFunctionEx<javax.jms.Session,T,javax.jms.Message> messageFn)
Sets the function which creates the message from the item.
|
JmsSinkBuilder<T> |
sendFn(BiConsumerEx<javax.jms.MessageProducer,javax.jms.Message> sendFn)
Sets the function which sends the message via message producer.
|
JmsSinkBuilder<T> |
sessionFn(FunctionEx<javax.jms.Connection,javax.jms.Session> sessionFn)
Sets the function which creates a session from a connection.
|
JmsSinkBuilder<T> |
sessionParams(boolean transacted,
int acknowledgeMode)
Sets the session parameters.
|
public JmsSinkBuilder<T> connectionParams(String username, String password)
connectionFn
is provided, these
parameters are ignored.username
- the username, Default value is null
password
- the password, Default value is null
public JmsSinkBuilder<T> connectionFn(@Nonnull FunctionEx<javax.jms.ConnectionFactory,javax.jms.Connection> connectionFn)
If not provided, the builder creates a function which uses ConnectionFactory#createConnection(username, password)
to create the
connection. See connectionParams(String, String)
.
public JmsSinkBuilder<T> sessionParams(boolean transacted, int acknowledgeMode)
sessionFn
is provided, these
parameters are ignored.transacted
- if true, marks the session as transacted.
Default value is false.acknowledgeMode
- sets the acknowledge mode of the session,
Default value is Session.AUTO_ACKNOWLEDGE
public JmsSinkBuilder<T> sessionFn(@Nonnull FunctionEx<javax.jms.Connection,javax.jms.Session> sessionFn)
If not provided, the builder creates a function which uses Connection#createSession(boolean transacted, int acknowledgeMode)
to
create the session. See sessionParams(boolean, int)
.
public JmsSinkBuilder<T> destinationName(@Nonnull String destinationName)
public JmsSinkBuilder<T> messageFn(BiFunctionEx<javax.jms.Session,T,javax.jms.Message> messageFn)
If not provided, the builder creates a function which wraps item.toString()
into a TextMessage
, unless the item
is already an instance of javax.jms.Message
.
public JmsSinkBuilder<T> sendFn(BiConsumerEx<javax.jms.MessageProducer,javax.jms.Message> sendFn)
If not provided, the builder creates a function which sends the message via
MessageProducer#send(Message message)
.
public JmsSinkBuilder<T> flushFn(ConsumerEx<javax.jms.Session> flushFn)
If not provided, the builder creates a no-op consumer.
Copyright © 2020 Hazelcast, Inc.. All rights reserved.