Coder Social home page Coder Social logo

simplengrinderstompclient's Introduction

Simple nGrinder Stomp Client

- This is simple client for stomp connection and message send test in ngrinder.

useage

  1. git clone and mvn build or download jar file.

  2. run ngrinder and move to script tab

  3. uploaded jar file to lib folder

  4. create script for jyphon

  5. import stomp client

    • from com.stomp.client import StompClient
  6. connection and message send

methods

1. addHeader(String headerName, String headerValue)

2. connect(String url)

  • 1 on success Return -1 on failure

3. sendMessage(String topic, String msg)

  • 1 on success Return -1 on failure

4. disconnect()

TODO:Subscribe...

example test script

from net.grinder.script.Grinder import grinder
from net.grinder.script import Test
from org.slf4j import LoggerFactory
from HTTPClient import NVPair
from org.json import JSONObject, JSONArray
from com.stomp.client import StompClient

test0 = Test(0, "conn")
params = []
class TestRunner:
	def __init__(self):
		grinder.statistics.delayReports=True
		params.append(NVPair("json", "data"))
		self.conn()

	def __call__(self):
		result = self.client.sendMessage("/chatroom/151", params)
		if not result:
			err("send msg error")
			grinder.statistics.forLastTest.success = 0
		else:
			grinder.statistics.forLastTest.success = 1

	def conn(self):
		self.client = StompClient()
		return self.client.connect("http://localhost:8080/chat")

test0.record(TestRunner.conn)

simplengrinderstompclient's People

Contributors

seongmun-hong avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

leeyunjea

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.