Skip to content

Instantly share code, notes, and snippets.

@hintjens
Created August 12, 2010 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hintjens/520825 to your computer and use it in GitHub Desktop.
Save hintjens/520825 to your computer and use it in GitHub Desktop.
You will need to patch base2/asl/pal/asl_pal_stdc.gsl:
ipr_process_wait (process, TRUE);
> rc = ipr_process_exitcode (process);
ipr_process_destroy (&process);
Run 'boom install' in base2/asl and 'boom build install' in openamq/common in order to get working PAL.
<?xml?>
<!-- Client side -->
<!-- Reads messages slowly from amq.direct with routing key "test" -->
<pal script = "amq_pal_gen">
<session direct = "1">
<queue_declare exclusive = "1" />
<queue_bind exchange = "amq.direct" routing_key = "test" />
<basic_consume no_ack = "1" exclusive = "1" />
<repeat>
<!-- Wait for and discard a message -->
<wait />
<basic_arrived>
<echo>Have message...</echo>
</basic_arrived>
<!-- Sleep for 1 second -->
<basic_content exec="sleep 1" />
</repeat>
</session>
</pal>
<?xml?>
<!-- Server side -->
<!-- Sends messages at full speed to amq.direct with routing key "test" -->
<pal script = "amq_pal_gen">
<session>
<repeat>
<basic_content size = "1000" />
<basic_publish exchange = "amq.direct" routing_key = "test" />
</repeat>
</session>
</pal>
Demonstrating WireAPI overflow in direct mode.
Window 1
amq_server --direct 1
Window 2
server
Window 3
client
Window 4
top
We see memory of client process increase without limit. Whereas the high-water mark is set to 500 messages.
<?xml?>
<config>
<echo>Configuring client</echo>
<tuning
low_water = "200"
high_water = "500"
direct = "1"
/>
<direct
batching = "32768"
on_overflow = "trim"
/>
</config>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment