Questo contenuto non è disponibile nella lingua selezionata.

39.4. Sort Messages by Operation Name


The operationName header

When the WS endpoint parses an incoming operation invocation in PAYLOAD mode, it automatically sets the operationName header to the name of the invoked operation. You can then use this header to sort messages by operation name.

Sorting by operation name

For example, the customer-ws-camel-cxf-payload demonstration defines the following route, which uses the content-based router pattern to sort incoming messages, based on the operation name. The when predicates check the value of the operationName header using simple language expressions, sorting messages into invocations on the updateCustomer operation, the lookupCustomer operation, or the getCustomerStatus operation.
<beans ...>
    ...
    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="cxf:bean:customer-ws?dataFormat=PAYLOAD"/>
            <choice>
                <when>
                    <simple>${in.header.operationName} == 'updateCustomer'</simple>
                    ...
                </when>
                <when>
                    <simple>${in.header.operationName} == 'lookupCustomer'</simple>
                    ...
                </when>
                <when>
                    <simple>${in.header.operationName} == 'getCustomerStatus'</simple>
                    ...
                </when>
            </choice>
        </route>
    </camelContext>

</beans>
Copy to Clipboard Toggle word wrap
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