Questo contenuto non è disponibile nella lingua selezionata.

43.2. Tuning JMS


Optimization is possible in the following areas when using the JMS API:
  • Disable message id. Use the setDisableMessageID() method on the MessageProducer class to disable message ids if not needed. This decreases the size of the message and also avoids the overhead of creating a unique ID.
  • Disable message time stamp. Use the setDisableMessageTimeStamp() method on the MessageProducer class to disable message timestamps not required.
  • Avoid ObjectMessage. ObjectMessage is convenient but it comes at a cost. The body of a ObjectMessage uses Java serialization to serialize it to bytes. The Java serialized form of even small objects is verbose, resulting in increased server traffic, also Java serialization is slow in comparison to custom marshaling techniques. Only use ObjectMessage if one of the other message types are unsuitable (for example, if the type of payload is unknown until run-time).
  • Avoid AUTO_ACKNOWLEDGE. AUTO_ACKNOWLEDGE mode requires an acknowledgment to be sent from the server for each message received on the client, this means more traffic on the network. If possible, use DUPS_OK_ACKNOWLEDGE, or use CLIENT_ACKNOWLEDGE or a transacted session and batch up many acknowledgments with one acknowledge/commit.
  • Avoid durable messages. By default JMS messages are durable. If really durable messages are not required, set the messages to be non-durable. Durable messages incur much more overhead in persisting them to storage.
  • Batch many sends or acknowledgments in a single transaction. HornetQ will only require a network round trip on the commit, not on every send or acknowledgment.
Torna in cima
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2025 Red Hat