Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 4. Configuration


The following options can be used in an application-properties file to configure your Spring Boot application.

4.1. Connection options

These options determine how AMQ Spring Boot Starter establishes connections to remote AMQP peers. The starter uses AMQ JMS to communicate over the network. For more information, see Using the AMQ JMS Client.

amqphub.amqp10jms.remoteUrl

The connection URI that the AMQ JMS client uses to establish new connections.

Connection URI format

amqp[s]://host:port[?option=value[&option2=value...]]

For more information, see Connection URIs in Using the AMQ JMS Client.

amqphub.amqp10jms.username
The username used to authenticate the connection.
amqphub.amqp10jms.password
The password used to authenticate the connection.
amqphub.amqp10jms.clientId
The client ID applied to the connection.
amqphub.amqp10jms.receiveLocalOnly
If enabled, calls to receive with a timeout argument check the consumer’s local message buffer only. Otherwise, the remote peer is checked as well to ensure there are no messages available. It is disabled by default.
amqphub.amqp10jms.receiveNoWaitLocalOnly
If enabled, calls to receiveNoWait check the consumer’s local message buffer only. Otherwise, the remote peer is checked as well to ensure there are no messages available. It is disabled by default.

4.2. Pooling options

These options determine how AMQ Spring Boot Starter caches JMS connections and sessions. The starter uses AMQ JMS Pool for its pooling. For more information, see Using the AMQ JMS Pool Library.

amqphub.amqp10jms.pool.enabled
Controls whether pooling is enabled. It is disabled by default.
amqphub.amqp10jms.pool.maxConnections
The maximum number of connections for a single pool. The default is 1.
amqphub.amqp10jms.pool.maxSessionsPerConnection

The maximum number of sessions for each connection. The default is 500. A negative value removes any limit.

If the limit is exceeded, createSession() either blocks or throws an exception, depending on configuration.

amqphub.amqp10jms.pool.blockIfSessionPoolIsFull

If enabled, calls to createSession() block until a session becomes available in the pool. It is enabled by default.

If disabled, calls to createSession() throw an IllegalStateException if no session is available.

amqphub.amqp10jms.pool.blockIfSessionPoolIsFullTimeout
The time in milliseconds before a blocked call to createSession() throws an IllegalStateException. The default is -1, meaning the call blocks forever.
amqphub.amqp10jms.pool.connectionIdleTimeout
The time in milliseconds before a connection not currently on loan can be evicted from the pool. The default is 30 seconds. A value of 0 disables the timeout.
amqphub.amqp10jms.pool.connectionCheckInterval
The time in milliseconds between periodic checks for expired connections. The default is 0, meaning the check is disabled.
amqphub.amqp10jms.pool.useAnonymousProducers

If enabled, use a single anonymous JMS MessageProducer for all calls to createProducer(). It is enabled by default.

In rare cases, this behavior is undesirable. If disabled, every call to createProducer() results in a new MessageProducer instance.

amqphub.amqp10jms.pool.explicitProducerCacheSize
When not using anonymous producers, the JMS Session can be configured to cache a certain number of MessageProducer objects with explicit destinations. As new producers are created that do not match the cached producers, the oldest entry in the cache is evicted.
amqphub.amqp10jms.pool.useProviderJMSContext

If enabled, use the JMSContext classes of the underlying JMS provider. It is disabled by default.

In normal operation, the pool uses its own generic JMSContext implementation to wrap connections from the pool instead of using the provider implementation. The generic implementation might have limitations the provider implementation does not. However, when enabled, connections from the JMSContext API are not managed by the pool.

Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.