Skip to main content
Back to blog
tutorials 11 May 2020 2 min read

JMeter Inter-Thread Communication

Learn how to enable communication between separate thread groups in Apache JMeter using the FIFO queue plugin for advanced test scenarios.

M

Mark

Performance Testing Expert

Thread groups within Apache JMeter are designed to be self-contained units with private variables. This article explains how to enable communication between separate thread groups using a FIFO (First In, First Out) queue plugin.

Installation

  1. Download plugins-manager.jar from jmeter-plugins.org
  2. Place it in JMeter’s lib/ext directory
  3. Restart JMeter
  4. Open Options > Plugins Manager
  5. Search for “fifo” and select “Inter-Thread Communication”
  6. Apply changes and restart

Available Elements

The plugin provides six components:

ElementDescription
Inter-Thread Communication PostProcessorQueues an item
Inter-Thread Communication PreProcessorRetrieves queued items
fifoPutAdds items to queue
fifoGetReads without removal (returns empty string if queue is empty)
fifoPopReads and removes items (waits for data availability)
fifoSizeDisplays queue item count

Practical Example

Here’s how to create a two-thread-group test plan with inter-thread communication:

Thread Group 1 - Producer

  1. Add an HTTP Request sampler to fetch data
  2. Add a Boundary Extractor to extract values:
    • Reference Name: blogPost
    • Left Boundary: <title>
    • Right Boundary: </title>
  3. Add an Inter-Thread Communication PostProcessor:
    • Queue Name: myQueue
    • Variable: ${blogPost}

Thread Group 2 - Consumer

  1. Add an Inter-Thread Communication PreProcessor:
    • Queue Name: myQueue
    • Variable Name: receivedValue
  2. Add your HTTP Request using ${receivedValue}

Configuration Tips

  • Ensure Thread Group 1 starts before Thread Group 2
  • Use the fifoPop function for blocking reads (waits for data)
  • Use fifoGet for non-blocking reads (returns empty if no data)
  • Monitor queue size with fifoSize to prevent memory issues

Use Cases

  • Passing authentication tokens between thread groups
  • Coordinating dependent API calls
  • Simulating producer-consumer patterns
  • Sharing session data across user journeys

Further Reading

Tags:

#jmeter #performance-testing #thread-groups #plugins

Need help with performance testing?

Let's discuss how I can help improve your application's performance.

Get in Touch