Coder Social home page Coder Social logo

rollno748 / jmeter-pubsub-sampler Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 4.0 941 KB

JMeter plugin to Publish and Subscribe Messages to GCP

License: MIT License

Java 100.00%
jmeter jmeter-plugin jmeter-pubsub-sampler jmeter-scripting jmeter-gcp gcp-pubsub jmetergcp jmeterpubsub gcp pubsub

jmeter-pubsub-sampler's Introduction

Jmeter-GCP-PubSub-Sampler

Introduction

This plugin adds feature to connect to GCP to publish/subscribe messages to the topic

Required Components

  1. Apache Jmeter/DI-Jmeter
  2. GCP Pubsub configs

Jar Dependencies Required

  • google-cloud-pubsub-1.111.2.jar
  • gson-2.2.4.jar

Jmeter Target

  • Jmeter version 5.3 or above
  • Java 8 or above

Installation Instructions

  • Download the source code from the Gitlab.
  • Just do a mvn clean install (Git bash is required)
  • Jar will be generated under the target directory (jmeter-pubsub-sampler-1.1.jar).
  • Copy the Jar to <Jmeter Installed Directory>/lib/ext/ for DI Jmeter <Jmeter Installed Directory>/di/plugins

How to use it

Add required config element (Publisher config/ Subscriber config)

  • Provide the required credentials information in the Publisher config/ Subscriber config for the project
  • To publish message, Add Publisher sampler to TG and then pass the message to publish
  • To receive message, Add Subscriber sampler to TG to read the mesasges

Publisher Info

Apart from config element, Publisher sampler has Gzip compression feature

  • The Flag in the sampler will allow the mechanism to publish the message with/without Gzip compression
  • On successful publish of each message, GCP returns a unique Id which will be returned in response header.
  • Supports attributes for messages being published
  • Supports multiple topic publishing feature in the same test plan

Subscriber Info

The subscriber works perfectly. The current mechanism of Subscriber is

  • The config elements creats a local queue to store the messages received from the GCP.
  • Currently the Queue size is hardcoded to 100K
  • The Subscriber sampler is bound to read it form the queue, which is already subscribed by the Message receiver(which is a separate client library's thread)
  • The subscriber sampler is reading and removing the message from the queue. In future, will change the ack to be done by the sampler.
  • When the susbcriber sampler is triggered and If there is no messages in the queue, It will wait until a new message arrive to process it.
  • each message retrieved from the subscriber will have the message ID and publish time info along with the message.
  • The message ID and publish time info will be returned in response headers and message on response body
  • The subscriber sampler supports De-Compression, If the message is in gzip compressed format.
  • Supports multiple topic subscription feature in the same test plan

Changes

  • Upgraded pub-sub client version to 1.111.2
  • Supports Attributes for sending messages
  • Supports multi-topic publishing, subscribing on same test plan

References

Below are the references which guided to build this plugin.

๐Ÿ’ฒ Support Me

If this project help you reduce time to develop, you can give me a cup of coffee :)

paypal

Please rate a ๐ŸŒŸ if you like it / benefits you.

Please open up an issue (:beetle:) - If you experienced something.

jmeter-pubsub-sampler's People

Contributors

cr-orilibhaber avatar dependabot[bot] avatar mi185051 avatar rollno748 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jmeter-pubsub-sampler's Issues

Adding publisher config

Hello!

When I try to add config for a publisher Add > Config element > PubSub-PublisherConfiguration nothing happens. How should the config be given? Should a section open in the right side of jMeter as it does while adding other configs?

Using jMeter 5.4.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.