Starlight for JMS configuration reference

A complete configuration reference for Starlight for JMS.

Configuration information is passed to the PulsarConnectionFactory constructor:

Map<String, Object> configuration = new HashMap<>();
configuration.put("...","...");
ConnectionFactory factory = new PulsarConnectionFactory(configuration);
...
factory.close();

Configuration information can also be passed as a JSON encoded string:

String configuration = "{.....}";
ConnectionFactory factory = new PulsarConnectionFactory();
factory.setJsonConfiguration(configuration);
...
factory.close();

Once you’ve instantiated the ConnectionFactory you can no longer change the configuration.

Configuration options

Configuration Entry Required Type Default value Notes

ackTimeout

no

long

Disabled

Set timeout for unacked messages. Must be >1 second.

ackTimeoutMillis

no

long

Same as ackTimeout, but expressed in milliseconds

brokerServiceUrl

no

String

If not specified, for Pulsar standalone instances running on localhost, defaults to the same value as webServiceUrl, http://localhost:8080. Can also be specified as pulsar://localhost:6650 for Pulsar standalone instances on localhost.

The URL to connect to the Pulsar broker or proxy
The brokerServiceUrl must be specified for Astra Streaming. Must be customized as required for Pulsar standalone instances that are not running on localhost.

consumerConfig

no

Map<String,Object>

Empty Map

Additional configuration for each Pulsar Consumer.
For all valid consumer objects, see the Apache Pulsar documentation.

enableTransaction

no

boolean

false

Enable transactions
enableTransaction defaults to false because transaction support is not enabled by default in Pulsar 2.7 and the client cannot connect to a cluster that does not enable transactions.

jms.acknowledgeRejectedMessages

no

boolean

false

Force acknowledgment of filtered messages on shared subscriptions
By default, filtered messages are negatively acknowledged on shared subscriptions. If this flag is true, they are acknowledged in order to skip them definitively.

jms.clientId

no

String

empty string

Administratively assigned clientId (see the JMS specs)
The default value assigned to every Connection.

jms.emulateTransactions

no

boolean

false

When a SESSION_TRANSACTED session is created in this mode, the Session behaves like a transacted Session but is not transactional: a produced message is sent immediately, and acknowledgements are sent during session.commit().
See Transaction Emulation.

jms.enableClientSideEmulation

no

boolean

false

Enable emulated features
Enable features that are not supported directly by the Pulsar Broker but are emulated on the client side.

jms.forceDeleteTemporaryDestinations

no

boolean

false

Force the deletion of temporary destinations
Use the Pulsar API to force the deletion even if the temporary destination has active subscriptions.

jms.precreateQueueSubscription

no

boolean

true

When set to false, the JMS client will not pre-create the subscription jms-queue
Set allowAutoSubscriptionCreation=false in broker.conf to disable subscription auto-creation on the broker.

jms.queueSubscriptionName

no

String

jms-queue

Name of the system subscription used to emulate JMS Queues

jms.systemNamespace

no

String

public/default

Default Pulsar namespace in which temporary destinations and destinations without an explicit namespace are created

jms.topicSharedSubscriptionType

no

String

Shared

Type of subscription for Shared consumers - Shared|Key_shared|Failover
Type of subscription is defined when a consumer connects to the subscription.

jms.useCredentialsFromCreateConnection

no

boolean

false

Makes authParams the username/password pair passed to ConnectionFactory.createConnection(username, password) and ConnectionFactory.createContext(username, password, mode)

jms.useExclusiveSubscriptionsForSimpleConsumers

no

boolean

true

Use an Exclusive subscription for Topic consumers
Set this to false to enable Delayed Messages.

jms.usePulsarAdmin

no

boolean

true

Allow the client to use the Pulsar Admin API
Set this to false if your client cannot access the Admin HTTP API.

jms.useServerSideFiltering

no

boolean

false

Offloads message filtering to the Broker nodes. See Server Side Filters.

jms.waitForServerStartupTimeout

no

number

60000

Grace period in ms to wait for the Pulsar broker to be available
Used to wait for Queue subscriptions to be ready.

negativeAckRedeliveryBackoff

no

RedeliveryBackoff

MultiplierRedeliveryBackoff

Interface for custom message is ackTimeout policy. You can specify RedeliveryBackoff for a consumer.

producerConfig

no

Map<String,Object>

Empty Map

Additional configuration for each Pulsar Producer

webServiceUrl

yes

String

http://localhost:8080 (default)

Main Pulsar HTTP endpoint
Must be customized as required for Pulsar standalone instances that are not running on localhost.

All other options are passed as configurations to the Pulsar Client and the Pulsar Admin client, allowing you to configure additional Pulsar features, including security.

Please check Apache Pulsar documentation for a complete list of configuration options.

Implementation details

Please refer to Implementation details in order to read about how Starlight for JMS emulates some features that are not directly supported by Pulsar.

Next