public final class JmsSourceBuilder extends Object
Sources.jmsQueueBuilder(com.hazelcast.jet.function.SupplierEx<? extends javax.jms.ConnectionFactory>)
or Sources.jmsTopicBuilder(com.hazelcast.jet.function.SupplierEx<? extends javax.jms.ConnectionFactory>)
.Modifier and Type | Method and Description |
---|---|
StreamSource<javax.jms.Message> |
build()
Convenience for
build(FunctionEx) . |
<T> StreamSource<T> |
build(FunctionEx<? super javax.jms.Message,? extends T> projectionFn)
Creates and returns the JMS
StreamSource with the supplied
components and the projection function projectionFn . |
JmsSourceBuilder |
connectionFn(FunctionEx<? 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(FunctionEx<? 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(ConsumerEx<? super javax.jms.Session> flushFn)
Sets the function which commits the session after consuming each message.
|
JmsSourceBuilder |
sessionFn(FunctionEx<? 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.
|
public JmsSourceBuilder 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 JmsSourceBuilder connectionFn(@Nonnull FunctionEx<? super javax.jms.ConnectionFactory,? extends 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 JmsSourceBuilder sessionParams(boolean transacted, int acknowledgeMode)
sessionFn
is provided these
parameters are ignored.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
public JmsSourceBuilder sessionFn(@Nonnull FunctionEx<? super javax.jms.Connection,? extends 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 JmsSourceBuilder destinationName(String destinationName)
consumerFn
is provided this
parameter is ignored.public JmsSourceBuilder consumerFn(@Nonnull FunctionEx<? super javax.jms.Session,? extends javax.jms.MessageConsumer> consumerFn)
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)
.
public JmsSourceBuilder flushFn(@Nonnull ConsumerEx<? super javax.jms.Session> flushFn)
If not provided, the builder creates a no-op consumer.
public <T> StreamSource<T> build(@Nonnull FunctionEx<? super javax.jms.Message,? extends T> projectionFn)
StreamSource
with the supplied
components and the projection function projectionFn
.T
- the type of the items the source emitsprojectionFn
- the function which creates output object from each
messagepublic StreamSource<javax.jms.Message> build()
build(FunctionEx)
.Copyright © 2020 Hazelcast, Inc.. All rights reserved.