consume Activemq message from jmeter - jmeter

<SubscriberSampler guiclass="JMSSubscriberGui" testclass="SubscriberSampler" testname="JMS Subscriber" enabled="true">
<stringProp name="jms.jndi_properties">false</stringProp>
<stringProp name="jms.initial_context_factory">org.apache.activemq.jndi.ActiveMQInitialContextFactory</stringProp>
<stringProp name="jms.provider_url">tcp://127.0.0.1:61610</stringProp>
<stringProp name="jms.connection_factory">ConnectionFactory</stringProp>
<stringProp name="jms.topic">dynamicQueue/MyQueue</stringProp>
<stringProp name="jms.security_principle">admin</stringProp>
<stringProp name="jms.security_credentials">admin</stringProp>
<boolProp name="jms.authenticate">true</boolProp>
<stringProp name="jms.iterations">1</stringProp>
<stringProp name="jms.read_response">false</stringProp>
<stringProp name="jms.client_choice">jms_subscriber_on_message</stringProp>
<stringProp name="jms_error_reconnect_on_codes"></stringProp>
<stringProp name="jms.selector">type=&apos;Queue&apos;</stringProp>
</SubscriberSampler>
I need consume active mq message from jmeter
I have configured JMS Subscriber but getting errer message
Thread Name: Thread Group 1-1
Sample Start: 2019-09-11 18:52:42 BST
Load time: 0
Connect Time: 0
Latency: 0
Size in bytes: 0
Sent bytes:0
Headers size in bytes: 0
Body size in bytes: 0
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 000
Response message: javax.naming.NameNotFoundException: dynamicQueue/MyQueue

Try with below queue name "dynamicQueues/MyQueue" instead of dynamicQueue/MyQueue
You can refer:
https://activemq.apache.org/how-to-unit-test-jms-code

NameNotFoundException: dynamicQueue/MyQueue
As per javax.naming.NameNotFoundException JavaDoc
This exception is thrown when a component of the name cannot be resolved because it is not bound.
Double check that the queue and/or topic exists and your user has enough rights to access it. The easiest way of checking is using the ActiveMQ Web Console
Check out Building a JMS Testing Plan - Apache JMeter article for instructions on sending/receiving JMS messages using JMeter

Related

Unknown protocol error when testing a website in jmeter

When I tried to test a website. The test result was like this:
Thread Name: Test new22 1-1
Sample Start: 1970-01-01 05:30:00 IST
Load time: 0
Connect Time: 0
Latency: 0
Size in bytes: 841
Sent bytes:0
Headers size in bytes: 0
Body size in bytes: 841
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: Non HTTP response code: java.net.MalformedURLException
Response message: Non HTTP response message: unknown protocol: stagingblueridge.com
HTTPSampleResult fields:
ContentType:
DataEncoding: null
Kindly anybody help me to resolve the above issue...

MiNiFi - NiFi Connection Failure: Unknown Host Exception : Able to telnet host from the machine where MiNiFi is running

I am running MiNiFi in a Linux Box (gateway server) which is behind my company's firewall. My NiFi is running on an AWS EC2 cluster (running in standalone mode).
I am trying to send data from the Gateway to NiFi running in AWS EC2.
From gateway, I am able to telnet to EC2 node with the public DNS and the remote port which I have configured in the nifi.properties file
nifi.properties
# Site to Site properties
nifi.remote.input.host=ec2-xxx.us-east-2.compute.amazonaws.com
nifi.remote.input.secure=false
nifi.remote.input.socket.port=1026
nifi.remote.input.http.enabled=true
nifi.remote.input.http.transaction.ttl=30 sec
nifi.remote.contents.cache.expiration=30 secs
Telnet connection from Gateway to NiFi
iot1#iothdp02:~/minifi/minifi-0.5.0/conf$ telnet ec2-xxx.us-east-2.compute.amazonaws.com 1026
Trying xx.xx.xx.xxx...
Connected to ec2-xxx.us-east-2.compute.amazonaws.com.
Escape character is '^]'.
The Public DNS is resolving to the correct Public IP of the EC2 node.
From the EC2 node, when I do nslookup on the Public DNS, it gives back the private IP.
From AWS Documentation: "The public IP address is mapped to the primary private IP address through network address translation (NAT). "
Hence, I am not adding the Public DNS and the Public IP in /etc/host file in the EC2 node.
From MiNiFi side, I am getting the below error:
minifi-app.log
iot1#iothdp02:~/minifi/minifi-0.5.0/logs$ cat minifi-app.log
2018-11-14 16:00:47,910 INFO [pool-31-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Initiating checkpoint of FlowFile Repository
2018-11-14 16:00:47,911 INFO [pool-31-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Successfully checkpointed FlowFile Repository with 0 records in 0 milliseconds
2018-11-14 16:01:02,334 INFO [Write-Ahead Local State Provider Maintenance] org.wali.MinimalLockingWriteAheadLog org.wali.MinimalLockingWriteAheadLog#67207d8a checkpointed with 0 Records and 0 Swap Files in 20 milliseconds (Stop-the-world time = 6 milliseconds, Clear Edit Logs time = 4 millis), max Transaction ID -1
2018-11-14 16:02:47,911 INFO [pool-31-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Initiating checkpoint of FlowFile Repository
2018-11-14 16:02:47,912 INFO [pool-31-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Successfully checkpointed FlowFile Repository with 0 records in 0 milliseconds
2018-11-14 16:03:02,354 INFO [Write-Ahead Local State Provider Maintenance] org.wali.MinimalLockingWriteAheadLog org.wali.MinimalLockingWriteAheadLog#67207d8a checkpointed with 0 Records and 0 Swap Files in 18 milliseconds (Stop-the-world time = 3 milliseconds, Clear Edit Logs time = 5 millis), max Transaction ID -1
2018-11-14 16:03:10,636 WARN [Timer-Driven Process Thread-8] o.a.n.r.util.SiteToSiteRestApiClient Failed to get controller from http://ec2-xxx.us-east-2.compute.amazonaws.com:9090/nifi-api due to java.net.UnknownHostException: ec2-xxx.us-east-2.compute.amazonaws.com: unknown error
2018-11-14 16:03:10,636 WARN [Timer-Driven Process Thread-8] o.apache.nifi.controller.FlowController Unable to communicate with remote instance RemoteProcessGroup[http://ec2-xxx.us-east-2.compute.amazonaws.com:9090/nifi] due to org.apache.nifi.controller.exception.CommunicationsException: org.apache.nifi.controller.exception.CommunicationsException: Unable to communicate with Remote NiFi at URI http://ec2-xxx.us-east-2.compute.amazonaws.com:9090/nifi due to: ec2-xxx.us-east-2.compute.amazonaws.com: unknown error
2018-11-14 16:04:47,912 INFO [pool-31-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Initiating checkpoint of FlowFile Repository
2018-11-14 16:04:47,912 INFO [pool-31-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Successfully checkpointed FlowFile Repository with 0 records in 0 milliseconds
2018-11-14 16:05:02,380 INFO [Write-Ahead Local State Provider Maintenance] org.wali.MinimalLockingWriteAheadLog org.wali.MinimalLockingWriteAheadLog#67207d8a checkpointed with 0 Records and 0 Swap Files in 25 milliseconds (Stop-the-world time = 8 milliseconds, Clear Edit Logs time = 6 millis), max Transaction ID -1
2018-11-14 16:06:47,912 INFO [pool-31-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Initiating checkpoint of FlowFile Repository
2018-11-14 16:06:47,912 INFO [pool-31-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Successfully checkpointed FlowFile Repository with 0 records in 0 milliseconds
2018-11-14 16:07:02,399 INFO [Write-Ahead Local State Provider Maintenance] org.wali.MinimalLockingWriteAheadLog org.wali.MinimalLockingWriteAheadLog#67207d8a checkpointed with
MiNiFi config.yml
MiNiFi Config Version: 3
Flow Controller:
name: Gateway-IDS_v0.1
comment: "1. ConsumeMQTT - MiNiFi will consume mqtt messages in gateway\n2. Remote\
\ Process Group will send messages to NiFi "
Core Properties:
flow controller graceful shutdown period: 10 sec
flow service write delay interval: 500 ms
administrative yield duration: 30 sec
bored yield duration: 10 millis
max concurrent threads: 1
variable registry properties: ''
FlowFile Repository:
partitions: 256
checkpoint interval: 2 mins
always sync: false
Swap:
threshold: 20000
in period: 5 sec
in threads: 1
out period: 5 sec
out threads: 4
Content Repository:
content claim max appendable size: 10 MB
content claim max flow files: 100
always sync: false
Provenance Repository:
provenance rollover time: 1 min
implementation: org.apache.nifi.provenance.MiNiFiPersistentProvenanceRepository
Component Status Repository:
buffer size: 1440
snapshot frequency: 1 min
Security Properties:
keystore: ''
keystore type: ''
keystore password: ''
key password: ''
truststore: ''
truststore type: ''
truststore password: ''
ssl protocol: ''
Sensitive Props:
key:
algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
provider: BC
Processors:
- id: 6396f40f-118f-33f4-0000-000000000000
name: ConsumeMQTT
class: org.apache.nifi.processors.mqtt.ConsumeMQTT
max concurrent tasks: 1
scheduling strategy: TIMER_DRIVEN
scheduling period: 0 sec
penalization period: 30 sec
yield period: 1 sec
run duration nanos: 0
auto-terminated relationships list: []
Properties:
Broker URI: tcp://localhost:1883
Client ID: nifi
Connection Timeout (seconds): '30'
Keep Alive Interval (seconds): '60'
Last Will Message:
Last Will QoS Level:
Last Will Retain:
Last Will Topic:
MQTT Specification Version: '0'
Max Queue Size: '10'
Password:
Quality of Service(QoS): '0'
SSL Context Service:
Session state: 'true'
Topic Filter: MQTT
Username:
Controller Services: []
Process Groups: []
Input Ports: []
Output Ports: []
Funnels: []
Connections:
- id: f0007aa3-cf32-3593-0000-000000000000
name: ConsumeMQTT/Message/85ebf198-0166-1000-5592-476a7ba47d2e
source id: 6396f40f-118f-33f4-0000-000000000000
source relationship names:
- Message
destination id: 85ebf198-0166-1000-5592-476a7ba47d2e
max work queue size: 10000
max work queue data size: 1 GB
flowfile expiration: 0 sec
queue prioritizer class: ''
Remote Process Groups:
- id: c00d3132-375b-323f-0000-000000000000
name: ''
url: http://ec2-xxx.us-east-2.compute.amazonaws.com:9090
comment: ''
timeout: 30 sec
yield period: 10 sec
transport protocol: RAW
proxy host: ''
proxy port: ''
proxy user: ''
proxy password: ''
local network interface: ''
Input Ports:
- id: 85ebf198-0166-1000-5592-476a7ba47d2e
name: From MiNiFi
comment: ''
max concurrent tasks: 1
use compression: false
Properties:
Port: 1026
Host Name: ec2-xxx.us-east-2.compute.amazonaws.com
Output Ports: []
NiFi Properties Overrides: {}
Any pointers on how to troubleshoot this issue?
In MiNiFi config.yml, I changed the URL under Remote Process Groups from http://ec2-xxx.us-east-2.compute.amazonaws.com:9090 to http://ec2-xxx.us-east-2.compute.amazonaws.com:9090/nifi.

JMeter StackOverflow

I am using JMeter 2.11. The following parameters are defined in the jmeter.bat file :
set HEAP=-Xms512m -Xmx12144m
set PERM=-XX:PermSize=64m -XX:MaxPermSize=64m
I run my scenario in batch mode with 50 users. It appears some threads are blocked during 20 min or 1 hour and run again after. For example, we have the following with the unit group 6:
<httpSample t="13" lt="13" ts="1410856270124" s="true" lb="/hopex/service.aspx?data=generationType-standard|generator-E98AEA3A4F717715" rc="200" rm="OK" tn="Groupe d'unités 1-6" dt="text" by="412">
<java.net.URL>http://172.16.1.23/hopex/service.aspx?data=generationType-standard|generator-E98AEA3A4F717715</java.net.URL>
</httpSample>
**executed at 16/09/2014 10:31:10**
<httpSample t="0" lt="0" ts="1410856270138" s="true" lb="/hopex/statesessionprovider.aspx" rc="200" rm="OK" tn="Groupe d'unités 1-6" dt="text" by="238">
<java.net.URL>http://172.16.1.23/hopex/statesessionprovider.aspx</java.net.URL>
</httpSample>
**executed at 16/09/2014 10:31:10**
<sample t="0" lt="0" ts="1410856274818" s="true" lb="Timer between steps" rc="200" rm="OK" tn="Groupe d'unités 1-6" dt="text" by="1478"/>
**executed at 16/09/2014 10:31:15**
<httpSample t="3" lt="3" ts="1410860493293" s="false" lb="/Hopex/service.aspx?data=generationType-standard|generator-E98AEA3A4F717715" rc="500" rm="Internal Server Error" tn="Groupe d'unités 1-6" dt="text" by="298">
<java.net.URL>http://172.16.1.23/Hopex/service.aspx?data=generationType-standard|generator-E98AEA3A4F717715</java.net.URL>
</httpSample>
**executed at 16/09/2014 11:41:33**
It appears the timers are executed at 10H31 and the next request is sent at 11H41, that is to say 1H10 after the timers. Our server application log shows that the last request has never been handled because of IIS
web application session timeout. So it means JMeter made a pause of more than one hour before sending the request. It should be noted that if we remove the JMeter while statement from our scenario, it works.
I retrieve this information from JMeter logs. It seems the problem comes from JMeter with stack overflow.
2014/09/16 10:30:49 WARN - jmeter.control.GenericController: StackOverflowError detected
2014/09/16 10:30:49 WARN - jmeter.control.GenericController: StackOverflowError detected
2014/09/16 10:30:49 WARN - jmeter.control.GenericController: StackOverflowError detected
2014/09/16 10:30:51 WARN - jmeter.control.GenericController: StackOverflowError detected
2014/09/16 10:31:00 INFO - jmeter.reporters.Summariser: summary + 196 in 30s = 6.5/s Avg: 154 Min: 0 Max: 11347 Err: 0 (0.00%) Active: 50 Started: 50 Finished: 0
2014/09/16 10:31:00 INFO - jmeter.reporters.Summariser: summary = 5974 in 1103s = 5.4/s Avg: 406 Min: 0 Max: 47864 Err: 0 (0.00%)
2014/09/16 10:31:01 WARN - jmeter.control.GenericController: StackOverflowError detected
2014/09/16 10:31:32 INFO - jmeter.reporters.Summariser: summary + 154 in 32s = 4.9/s Avg: 94 Min: 0 Max: 10982 Err: 0 (0.00%) Active: 50 Started: 50 Finished: 0
2014/09/16 10:31:32 INFO - jmeter.reporters.Summariser: summary = 6128 in 1135s = 5.4/s Avg: 399 Min: 0 Max: 47864 Err: 0 (0.00%)
2014/09/16 10:31:37 WARN - jmeter.control.GenericController: StackOverflowError detected
I tried to change JMeter.bat parameters using -XSS but we had side effects. I also ran the test with those parameters:
set HEAP=-Xms512m -Xmx12144m
set NEW=-XX:NewSize=128m -XX:MaxNewSize=128m
set SURVIVOR=-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50%
set TENURING=-XX:MaxTenuringThreshold=2
set RMIGC=-Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000
set PERM=-XX:PermSize=64m -XX:MaxPermSize=64m
Nothing change, the same problem applies.
Does anyone has an idea of how to remove those JMeter errors ?
This is quite blocking for us since it means JMeter could not handle correctly 50 users simultaneously...
Regards
Sylvie
Issue was due to a know bug in version 2.11 :
Listeners don't show iteration counts when a If Controller has a condition which is always false from the first iteration (see Bug 52496 ). A workaround is to add a sampler at the same level as (or superior to) the If Controller. For example a Test Action sampler with 0 wait time (which doesn't generate a sample), or a Debug Sampler with all fields set to False (to reduce the sample size).
Also opened as:
https://issues.apache.org/bugzilla/show_bug.cgi?id=56160
This bug is now fixed so will be available as 2.12
2014/09/16 10:31:37 WARN - jmeter.control.GenericController: StackOverflowError detected
This error can appear when there is a logical error in your test plan. Please check carefully with adding beanshell listener for printing extra logs within Logical controller such as looping/iterating controller in your test plan.
I believe that in the "set HEAP=-Xms512m -Xmx12144m " both values need to be the same.
I think that if you would try with "set HEAP=-Xms2048m -Xmx2048m " the error will be gone.
Just increase jmeter stack size by using -Xss option

Java issues on Jmeter

I have tried some scripting using jmeter, but I am getting issues.
Thread Name: Thread Group 1-1
Sample Start: 2014-02-10 13:57:36 IST
Load time: 1229
Latency: 0
Size in bytes: 1880
Headers size in bytes: 0
Body size in bytes: 1880
Sample Count: 1
Error Count: 1
Response code: Non HTTP response code: org.apache.http.conn.HttpHostConnectException
Response message: Non HTTP response message: Connection to http://wwwe.google.com refused
Response headers:
HTTPSampleResult fields:
ContentType:
DataEncoding: null
Please help me o this issue
You have a wrong url, change it by http://www.google.com

JMeter assertion failure

I am new to JMeter and the assertion concepts. I am encountering this error message when I attempted to execute a JMX file, containing assertions in JMeter:
Assertion error: false
Assertion failure: true
Assertion Failure Message: Test Failed: Variable(search result) not to equal /
received: NOT FOUND [[[[]]]]
comparison: NOT FOUND [[[[]]]]
The script is executed this way:
$java -jar ./apache-jmeter-2.10/bin/ApacheJMeter.jar -t ./jmeter-master/test.jmx -Jhost=myhost.com -Joutput_suffix=localtest
I have attempted to drop the contents of database table in MySQL, repopulate them, and re-execute the jmx file. However, it is still failing with the same error message above.
The jmeter.log indicates only the following information below:
2013/11/27 05:58:52 ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.OutOfMemoryError
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:284)
at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:27)
at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:130)
at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:85)
at org.mozilla.javascript.Context.compileImpl(Context.java:2394)
at org.mozilla.javascript.Context.compileString(Context.java:1335)
at org.mozilla.javascript.Context.compileString(Context.java:1324)
at org.mozilla.javascript.Context.evaluateString(Context.java:1076)
at org.apache.jmeter.control.IfController.evaluateCondition(IfController.java:110)
at org.apache.jmeter.control.IfController.next(IfController.java:167)
at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:214)
at org.apache.jmeter.control.GenericController.next(GenericController.java:174)
at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:223)
at org.apache.jmeter.control.GenericController.next(GenericController.java:174)
at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:214)
at org.apache.jmeter.control.GenericController.reInitializeSubController(GenericController.java:274)
at org.apache.jmeter.control.GenericController.reInitializeSubController(GenericController.java:275)
at org.apache.jmeter.control.IfController.next(IfController.java:178)
at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:214)
at org.apache.jmeter.control.GenericController.next(GenericController.java:174)
at org.apache.jmeter.control.LoopController.next(LoopController.java:118)
at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:223)
at org.apache.jmeter.control.GenericController.next(GenericController.java:174)
at org.apache.jmeter.control.LoopController.next(LoopController.java:118)
at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:223)
at org.apache.jmeter.control.GenericController.next(GenericController.java:174)
at org.apache.jmeter.control.LoopController.next(LoopController.java:118)
at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:223)
at org.apache.jmeter.control.GenericController.next(GenericController.java:174)
at org.apache.jmeter.control.LoopController.next(LoopController.java:118)
at org.apache.jmeter.threads.AbstractThreadGroup.next(AbstractThreadGroup.java:88)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255)
at java.lang.Thread.run(Thread.java:769)
This is message logged in the JTL file:
/</failureMessage>
</assertionResult>
</httpSample>
<httpSample t="436" lt="406" ts="1385112442588" s="true" lb="Homepage:Home" rc="200" rm="OK" tn="Thread Group 1-4" dt="text" by="238401" sc="1" ec="0" ng="6" na="6"/>
<httpSample t="111" lt="34" ts="1385112445679" s="false" lb="Search:Leads" rc="200" rm="OK" tn="Thread Group 1-2" dt="text" by="15237" sc="1" ec="1" ng="6" na="6">
<assertionResult>
<name>Check for found lead</name>
<failure>true</failure>
<error>false</error>
<failureMessage>Test failed: variable(searchResult) expected not to equal /
****** received : NOT_FOUND[[[]]]
****** comparison: NOT_FOUND[[[]]]
/</failureMessage>
</assertionResult>
</httpSample>
<httpSample t="138" lt="124" ts="1385112448413" s="false" lb="Search:Leads" rc="200" rm="OK" tn="Thread Group 1-4" dt="text" by="182785" sc="1" ec="1" ng="6" na="6">
<assertionResult>
<name>Check for found lead</name>
<failure>true</failure>
<error>false</error>
<failureMessage>Test failed: variable(searchResult) expected not to equal /
****** received : NOT_FOUND[[[]]]
****** comparison: NOT_FOUND[[[]]]
Here's the segment of the JMX file that was produced and executed:
<ResultCollector guiclass="TableVisualizer" testclass="ResultCollector" testname="Result Table" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>false</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>true</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
<threadCounts>true</threadCounts>
<sampleCount>true</sampleCount>
</value>
</objProp>
<stringProp name="filename">jmeter_output_${__P(output_suffix,generic)}.xml</stringProp>
</ResultCollector>
Can anyone please provide pointers on troubleshooting this error?
Thank you so much,
Ari.
The log said OutOfMemoryError.
You could try first with increase the memory like:
$java -Xms256m -Xmx512m -jar ./apache-jmeter-2.10/bin/ApacheJMeter.jar -t ./jmeter-master/test.jmx -Jhost=myhost.com -Joutput_suffix=localtest

Resources