Jmeter Unable to load class com.azure.messaging.eventhubs.EventDataBatch - jmeter

I have JMeter 5.2.1 installed in my system.
When I try to execute below code i am getting this error.
Response message:javax.script.ScriptException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during class generation: java.lang.NoClassDefFoundError: Unable to load class com.azure.messaging.eventhubs.EventDataBatch due to missing dependency org/apache/qpid/proton/amqp/messaging/Section
Code:
import com.azure.messaging.eventhubs.*
final String connectionString = 'EVENT HUBS NAMESPACE CONNECTION STRING'
final String eventHubName = 'EVENT HUB NAME'
// create a producer using the namespace connection string and event hub name
EventHubProducerClient producer = new EventHubClientBuilder()
.connectionString(connectionString, eventHubName)
.buildProducerClient()
// prepare a batch of events to send to the event hub
EventDataBatch batch = producer.createBatch()
batch.tryAdd(new EventData('Fifth event'))
// send the batch of events to the event hub
producer.send(batch)
// close the producer
producer.close()
Below are dependent libraries that i have it in LIB folder. Can you please let me know if i am missing any dependency or using wrong version
dependency.
amqp-client-5.7.1.jar
azure-core-1.13.0.jar
azure-core-amqp-2.0.2.jar
azure-core-test-1.5.3.jar
azure-eventhubs-3.2.2.jar
azure-identity-1.2.3.jar
azure-messaging-eventhubs-5.5.0.jar
jackson-annotations-2.9.0.jar
jackson-core-2.9.9.jar
jackson-databind-2.9.9.jar
jackson-dataformat-xml-2.9.9.jar
jackson-datatype-jsr310-2.9.9.jar
jackson-module-jaxb-annotations-2.9.9.jar
junit-jupiter-api-5.6.3.jar
junit-jupiter-engine-5.6.3.jar
junit-jupiter-params-5.6.3.jar
mockito-core-3.3.3.jar
proton-j-0.31.0.jar
qpid-proton-j-extensions-1.2.1.jar
reactive-streams-1.0.3.jar
reactor-core-3.3.12.RELEASE
reactor-test-3.3.12.RELEASE
slf4j-api-1.7.28
stax2-api-3.1.4
woodstox-core-5.1.0

The org/apache/qpid/proton/amqp/messaging/Section lives in proton-j-0.33.4.jar
I don't know where did you get your proton-j-0.31.0.jar from, my expectation is that you should stick to Microsoft Azure Client Library For Event Hubs ยป 5.5.0 and use dependency management system like Maven or Ivy in order to obtain the library with all its dependencies including the transitive ones.
Once you obtain them - copy all the .jar files to "lib" folder of your JMeter installation (or other location on JMeter Classpath) and restart JMeter to pick up the changes
Just in case here is how the list should look like:
azure-core-1.13.0.jar
azure-core-amqp-2.0.2.jar
azure-messaging-eventhubs-5.5.0.jar
jackson-annotations-2.11.3.jar
jackson-core-2.11.3.jar
jackson-databind-2.11.3.jar
jackson-dataformat-xml-2.11.3.jar
jackson-datatype-jsr310-2.11.3.jar
jackson-module-jaxb-annotations-2.11.3.jar
jakarta.activation-api-1.2.1.jar
jakarta.xml.bind-api-2.3.2.jar
netty-tcnative-boringssl-static-2.0.35.Final.jar
proton-j-0.33.4.jar
qpid-proton-j-extensions-1.2.3.jar
reactive-streams-1.0.3.jar
reactor-core-3.3.12.RELEASE.jar
slf4j-api-1.7.30.jar
stax2-api-4.2.1.jar
woodstox-core-6.2.1.jar
Also be aware that according to JMeter Best Practices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.4 (or whatever is the latest version available at JMeter Downloads page) as soon as possible.

Related

Send messages to AWS SQS using JMeter

I want to test the scenarios of sending message to AWS SQS from Jmeter. But i dont find any relevant procedure to do it. I came to know about awsmaster plugin but after installing it, it doesnot get installed(seems like a corrupted version)
I am trying with Custom code but there also, the attribute builder() of "sqs client" shows a warning as "This static method of interface SqsClient can only be accessed as SqsClient.builder"
So, can someone please guide how to send messages to SQS queue using Jmeter and the steps.Thanks
If you're willing to copy and paste the code to initialize the SqsClient you can take a look at AWS Java SDK Examples repository:
SqsClient sqsClient = SqsClient.builder()
.region(Region.US_WEST_2)
.credentialsProvider(ProfileCredentialsProvider.create())
.build();
Then you can send the message like it's described here:
CreateQueueRequest request = CreateQueueRequest.builder()
.queueName(queueName)
.build();
sqsClient.createQueue(request);
GetQueueUrlRequest getQueueRequest = GetQueueUrlRequest.builder()
.queueName(queueName)
.build();
String queueUrl = sqsClient.getQueueUrl(getQueueRequest).queueUrl();
SendMessageRequest sendMsgRequest = SendMessageRequest.builder()
.queueUrl(queueUrl)
.messageBody(message)
.delaySeconds(5)
.build();
sqsClient.sendMessage(sendMsgRequest);
The code can be placed in i.e. JSR223 Sampler, use Groovy as the scripting language.
Make sure to add necessary import statements, copy AWS Java SDK with all its dependencies to JMeter classpath and restart JMeter to pick up the jars.

Try to load CDN and invoke method in CDN js in JMeter

In our App, we are using Video Publishing API (https://static.opentok.com/v2/js/opentok.js).
The problem with my test case is, we are externally invoking a method "Connect(-,-)" in openttok.js.
But how we can achieve through JMeter to Test Video Publishing?
I tried with following way,
Test Plan
Thread Group
Http Request
call cdn: https://static.opentok.com/v2/js/opentok.js
Post Request:
JSR223 PostProcessor: use variable in CDN JS
//OT varible is available in OpenTok JS.
var session = OT.initSession(apiKey, sessionID);
These are the Screens:
Http Request for OpenTok.js
Post Processor:
But it throws an error
Caused by: jdk.nashorn.internal.runtime.ECMAException: ReferenceError: "OT" is not defined
I think, OpenTok not loading or not available to Post Processor Script.
How can I load OpenTok and use a variable within this Js?
You won't be able to do it this way as JMeter is not a browser and cannot execute JavaScript.
I would recommend the following approach
Download Opentok Server jar
Obtain all the dependencies, for OpenTok Server 3.0.0 they would be
async-http-client-1.9.40.jar
commons-beanutils-1.9.2.jar
commons-digester-1.8.1.jar
commons-lang-2.6.jar
commons-logging-1.2.jar
commons-validator-1.6.jar
jackson-annotations-2.9.0.pr4.jar
jackson-core-2.9.0.pr4.jar
jackson-databind-2.9.0.pr4.jar
jose4j-0.5.1.jar
netty-3.10.6.Final.jar
Put all the .jars under JMeter Classpath
Restart JMeter to pick the jars pu
Add JSR223 Sampler to your Test Plan
Use the following code to create a session:
import com.opentok.OpenTok
def apiKey = 123456789
def apiSecret = 'your_api_secret'
OpenTok opentok = new OpenTok(apiKey,apiSecret)
def session = opentok.createSession()
References:
OpenTok Java SDK Usage
OpenTok Documentation
Apache Groovy - Why and How You Should Use It

Parse iOS SDK not sending application Id

I'm testing out deploying my own parse server following the steps in the Parse Server Guide. I've got the server up and running and have been able to create and fetch objects via curl. I built a simple iOS app using the Parse SDK (1.14.2). I've initialized the SDK with the app id and server url as described in the Parse Server Guide. When I try to make requests, I get back unauthorized from the server. Digging further, I noticed that the SDK is not sending the application id header to the server. I modified the SDK to send the application id header and everything works. Am I missing a configuration step somewhere?
This is because you are not passing the ClientKey. In swift 3 you would pass it like this in the didFinishLaunchingWithOptions.
// Init Parse
let configuration = ParseClientConfiguration {
$0.applicationId = PARSE_APP_KEY
$0.clientKey = PARSE_CLIENT_KEY
$0.server = PARSE_SERVER_URL
$0.isLocalDatastoreEnabled = true
}
Parse.initialize(with: configuration)
If you are falling when trying to test CloudCode, then its because your parse-server is not passing the Javascript key. So just make sure you initialize the server to do so if this issue is related to Parse.Cloud function.

Finding EventHandler for specific event.topic

I'm discovering AEM workflows and the flow of the Request for Approval model. I've noticed (confirmed on AEM docs) that "if the user does not have the required privileges for publishing a specific page a workflow will be triggered to notify the appropriate person of your request to publish".
Trying to find how it's triggered I've found out ReplicationProcess that handles the activation action and sends a com/day/cq/wcm/workflow/req/for/activation event. Here is where I get lost - none of the AEM OSGi console known to me covers this relationship.
How can I find the event handler that is used for handling a specific event topic?
If you know the event topic you can use bundleContext to find reference to proper EventHandler OSGi service, e.g. using AEM Groovy Console :
ServiceReference[] sr = bundleContext.getServiceReferences(org.osgi.service.event.EventHandler.class, "(event.topics=com/day/cq/wcm/workflow/req/for/activation)")
for (i=0; i< sr.length; i++) {
println bundleContext.getService(sr[i])
}
Output
com.day.cq.wcm.workflow.impl.WcmWorkflowServiceImpl#618c5804
You can also use OSGi Felix Web Console (services tab) to find it:

Empty result from Virtual Member Manager IBM Websphere WAS 8.5

I am using IBM websphere application server, I am trying to access the default file repository from my application using the virtual member manager, below is the code I use, it works well but I got an empty result, I checked the fileRegistry.xml file and it contains users, can anyone tell my where is my problem?
DataObject root = SDOHelper.createRootDataObject();
DataObject searchCtrl = SDOHelper.createControlDataObject(root,null,SchemaConstants.DO_SEARCH_CONTROL);
searchCtrl.getList(SchemaConstants.PROP_PROPERTIES).add("uid");
searchCtrl.getList(SchemaConstants.PROP_SEARCH_BASES).add("o=defaultWIMFileBasedRealm");
searchCtrl.setString(SchemaConstants.PROP_SEARCH_EXPRESSION,"#xsi:type='PersonAccount' and uid='*'");
root = getVMMService().search(root);
System.out.println("Output data graph"+ printDO(root));
Does the getVMMService() method get an instance of LocalServiceProvider ? I run the example in an standAlone app, in the example http://www.ibm.com/developerworks/websphere/zones/portal/proddoc/dw-w-userrepository/ is call it via corba protocol, when I try with Servlets for testing, I comment those lines

Resources