Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

6.6.4. Last Value Queue Command-line Example


The included programs drain and spout can be used for sending and receiving messages for testing purposes. The source code for the two utilities is included in the Python and C++ client library packages. The Python version can be run uncompiled using a Python interpreter.
Run the following qpid-config command to create a Last Value Queue:
qpid-config add queue my-queue --argument qpid.last_value_queue_key=type
Copy to Clipboard Toggle word wrap
The header key 'type' is used to match messages in the queue.
Now start one or more browsers using the drain command:
./drain -f -c 0 'my-queue; {mode: browse}'
Copy to Clipboard Toggle word wrap
These browsers will see all the messages as they arrive in the queue in real-time.
Now use spout to send messages to the queue, setting a header value for the key 'type':
./spout -P type=a my-queue a1 
./spout -P type=a my-queue a2 
./spout -P type=a my-queue a3 
./spout -P type=b my-queue b1 
./spout -P type=c my-queue c1 
./spout -P type=c my-queue c2 
./spout -P type=a my-queue a4
Copy to Clipboard Toggle word wrap
The browsers started before these messages were published will see all messages as they arrive.
Now start a new browser:
./drain -c 0 'my-queue; {mode: browse}'
Copy to Clipboard Toggle word wrap
This browser will see only the last messages for each of the unique 'type' values.
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat