Este conteúdo não está disponível no idioma selecionado.

9.2. How to Enable Message Ordering Group


You can enable an ordering group either on a connection factory or on a producer:

9.2.1. Enabling Ordering Group on Producer

To enable the ordering group feature on producer, do the following:
  1. Add a JBossMessageProducer to your session:
    JBossMessageProducer producer=(JBossMessageProducer)session.createProducer(queue);
    Copy to Clipboard Toggle word wrap
  2. Add the enableOrderingGroup method to set an ordering group:
    producer.enableOrderingGroup(String ogrpName) throws JMSException
    Copy to Clipboard Toggle word wrap
    The method creates an ordering group; when the method is called, JBossMessageProducer sends messages on behalf of the ordering group. If you provide null as the method parameter, the ordering group is generated automatically. A new call to this method overrides the previous call.
  3. Optionally, you can add the disableOrderingGroup() method to disable the ordering group:
    public void disableOrderingGroup() throws JMSException
    Copy to Clipboard Toggle word wrap
    When the method is called, JBossMessageProducer stops sending ordering group messages and resumes its default behavior.
An example is available in $EAPHOME/doc/examples/jboss-messaging-examples/ordering-group/ in the class OrderingGroupExample.java (src/org/jboss/example/jms/ordering/OrderingGroupExample.java). Note that the example is delivered as part of the jboss-eap-docs archive.
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2026 Red Hat