public static class SubscribeOptions.SubscribeOptionsBuilder extends Object
SubscribeOptions
.Modifier and Type | Method and Description |
---|---|
SubscribeOptions |
build() |
SubscribeOptions.SubscribeOptionsBuilder |
setAutoConfirm(boolean autoConfirm)
Determines whether the client automatically confirms the receipt of
'at least once' quality of service messages.
|
SubscribeOptions.SubscribeOptionsBuilder |
setCredit(int credit)
Sets the maximum number of unconfirmed messages a client can have before the server will stop
sending new messages to the client and require that it confirms some of the outstanding message
deliveries in order to receive more messages.
|
SubscribeOptions.SubscribeOptionsBuilder |
setQos(QOS qos)
The quality of service to use for delivering messages to the subscription.
|
SubscribeOptions.SubscribeOptionsBuilder |
setShare(String shareName)
The share argument supplied used when subscribing to a destination.
|
SubscribeOptions.SubscribeOptionsBuilder |
setTtl(long ttl)
A time-to-live value, in milliseconds, that is applied to the destination that the client is subscribed to.
|
SubscribeOptions.SubscribeOptionsBuilder |
setTtl(long ttl,
TimeUnit unit)
A time-to-live value that is applied to the destination that the client is subscribed to.
|
public SubscribeOptions.SubscribeOptionsBuilder setAutoConfirm(boolean autoConfirm)
autoConfirm
- When set to true
(the default) the client will automatically
confirm delivery of messages when after calling the appropriate
DestinationListener#onMessage(NonBlockingClient, Object, Delivery)
or DestinationListener#onMalformed(NonBlockingClient, Object, BytesDelivery, com.ibm.mqlight.api.DestinationListener.MalformedReason)
method registered for the destination that the message was received from.
When set to false
, the application using the client is
responsible for confirming the delivery of messages using the
Delivery#confirm()
method). autoConfirm
is only applicable
to 'at least once' quality of service (see #setQos(QOS)
)SubscribeOptionsBuilder
that this method was invoked on.public SubscribeOptions.SubscribeOptionsBuilder setCredit(int credit) throws IllegalArgumentException
credit
- the credit value which must be >= 0. The default if this is not specified is 1024.SubscribeOptionsBuilder
that this method was invoked on.IllegalArgumentException
- if an invalid credit
value is specified.public SubscribeOptions.SubscribeOptionsBuilder setQos(QOS qos) throws IllegalArgumentException
qos
- The required quality of service. Cannot be null.SubscribeOptionsBuilder
that this method was invoked on.IllegalArgumentException
- if an invalid qos
value is specified.public SubscribeOptions.SubscribeOptionsBuilder setShare(String shareName) throws IllegalArgumentException
shareName
- the share argument used to subscribe to a destination. The
default is null
which is interpreted as "do not subscribe
to a shared destination - the destination is private to this client".
When specified, the share name must not contain a colon (:) character.SubscribeOptionsBuilder
that this method was invoked on.IllegalArgumentException
- if an invalid shareName
value is specified.public SubscribeOptions.SubscribeOptionsBuilder setTtl(long ttl) throws IllegalArgumentException
ttl
- a time to live value in milliseconds, the default being 0 - meaning the destination will be deleted as
soon as there are no clients subscribed to it. This must be a positive value, and when converted to
seconds it must be a maximum of 4294967295 (0xFFFFFFFF)SubscribeOptionsBuilder
that this method was invoked on.IllegalArgumentException
- if an invalid ttl
value is specified.public SubscribeOptions.SubscribeOptionsBuilder setTtl(long ttl, TimeUnit unit) throws IllegalArgumentException
ttl
- a time to live value in the given TimeUnit
, the default being 0 - meaning the destination will be
deleted as soon as there are no clients subscribed to it. This must be a positive value, and a maximum of
42949672950 (0xFFFFFFFF) once it has been converted to TimeUnit.SECONDS
unit
- TimeUnit
of the given ttl
argumentSubscribeOptionsBuilder
that this method was invoked on.IllegalArgumentException
- if an invalid ttl
value is specified.public SubscribeOptions build()
Copyright © 2015 International Business Machines Corporation. All rights reserved.