Bug 47394

Summary: It should be easier to plug a custom SampleSender in jmeter
Product: JMeter - Now in Github Reporter: benoit.wiart
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 2.3.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: sample sender factory patch
jmeter.properties patch
documentation patch

Description benoit.wiart 2009-06-19 01:58:53 UTC
It's not possible to plug a custom SampleSender without making change in SampleSenderFactory and recompiling jmeter.

It should be possible to provide the implementation class in the config file

If the jmeter dev / comitters thing are willing to accept this change then I will provide a patch (keeping backward compatibility)
Comment 1 benoit.wiart 2009-06-19 02:04:38 UTC
How it will be done (open to discussion) :

add a new optionnal parameter in the config file (ex : sample.sender.class)
If the parameter is set
    load the class and create a new instance of the samplesender
    if it fails default to StandardSampleSender + log the exception
else
    use the 'old' parameters 'mode' and 'hold_samples' 

Benoit Wiart
Ubik Ingénierie
www.ubik-ingenierie.com
Comment 2 Sebb 2009-06-19 04:49:15 UTC
This is a good idea.

Regarding properties: I don't think it's necessary to add yet another property; just set hold=false and mode=classname.

If the class is not found, I think the run should fail rather than reverting to StandardSampler.

Please submit a patch. Ideally this should cover the factory class, jmeter.properties and the user documentation.
Comment 3 benoit.wiart 2009-06-19 16:19:37 UTC
Created attachment 23836 [details]
sample sender factory patch
Comment 4 benoit.wiart 2009-06-19 16:21:30 UTC
Created attachment 23837 [details]
jmeter.properties patch
Comment 5 benoit.wiart 2009-06-19 16:24:15 UTC
Created attachment 23838 [details]
documentation patch
Comment 6 Sebb 2009-06-19 19:15:49 UTC
Thanks for the patches, which have been applied to SVN:

URL: http://svn.apache.org/viewvc?rev=786747&view=rev
Log:
Bug 47394 - It should be easier to plug a custom SampleSender in jmeter

The updated code will be in nightly builds after r786747.
Comment 7 The ASF infrastructure team 2022-09-24 20:37:43 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2249