Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JMS Publisher : reload file content if file name changes #3630

Closed
asfimport opened this issue Jul 21, 2015 · 7 comments
Closed

JMS Publisher : reload file content if file name changes #3630

asfimport opened this issue Jul 21, 2015 · 7 comments

Comments

@asfimport
Copy link
Collaborator

mchassagneux (Bug 58160):
I've made this little hack (see attachment) on the JMS Publisher component to disabled the cache when the file name change ( by example when you variabilize the field )

Could you look at it and add it if possible. May be on other component where cache is use.

Created attachment JMS_DisableCache.patch: Patch file to disable cache when filename change

JMS_DisableCache.patch
92,95d91
<     // Store file name
<     private String file_name = null;
<     
<     
257,259c253
< 			// reload file if name change !
<         	if (getInputFile() != file_name) {
<         		file_name = getInputFile();
---
>             if (file_contents == null) {
326,328c320
< 			// Reload file if name change !
<         	if (getInputFile() != file_name) {
<         		file_name = getInputFile();
---
>             if (bytes_msg_file_contents == null) {

OS: All

@asfimport
Copy link
Collaborator Author

UbikLoadPack support (migrated from Bugzilla):
Hello,
Your patch cannot be used as we don't know to which class it applies.

How did you create it ?

You should first read this:
http://wiki.apache.org/jmeter/JMeterDevelopment
http://wiki.apache.org/jmeter/JMeterEclipse
http://wiki.apache.org/jmeter/CommittingChanges (This link gives high level steps)

Then to submit a patch, in Eclipse :
Right click on JMeter projet > Team > create patch and select the files you want to include in patch.

Regards

@asfimport
Copy link
Collaborator Author

mchassagneux (migrated from Bugzilla):
(In reply to UbikLoadPack support from comment 1)

Hello,
Your patch cannot be used as we don't know to which class it applies.

How did you create it ?

You should first read this:
http://wiki.apache.org/jmeter/JMeterDevelopment
http://wiki.apache.org/jmeter/JMeterEclipse
http://wiki.apache.org/jmeter/CommittingChanges (This link gives high level
steps)

Then to submit a patch, in Eclipse :
Right click on JMeter projet > Team > create patch and select the files you
want to include in patch.

Regards

Ho sry, I use WinMerge to do it ...

I will look an other way to generate it...

@asfimport
Copy link
Collaborator Author

mchassagneux (migrated from Bugzilla):
The patch was made on "src\protocol\jms\org\apache\jmeter\protocol\jms\sampler\PublisherSampler.java" file.

@asfimport
Copy link
Collaborator Author

mchassagneux (migrated from Bugzilla):
new version of the patch

Created attachment JMS_DisableCache.patch: Patch file to disable cache when filename change

JMS_DisableCache.patch
diff  C:/perso_max/workspace/JMeter_2.12/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/PublisherSampler.java C:/perso_max/workspace/JMeter/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/PublisherSampler.java
92,95d91
<     // Store file name
<     private String file_name = null;
<     
<     
257,259c253
< 			// reload file if name change !
<         	if (getInputFile() != file_name) {
<         		file_name = getInputFile();
---
>             if (file_contents == null) {
326,328c320
< 			// Reload file if name change !
<         	if (getInputFile() != file_name) {
<         		file_name = getInputFile();
---
>             if (bytes_msg_file_contents == null) {

@asfimport
Copy link
Collaborator Author

Zafiu Andrei (migrated from Bugzilla):
Any news on applying this patch? I can confirm it and it applies since version 2.7 of apache jmeter.

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
Author: pmouawad
Date: Wed Nov 11 13:49:31 2015
New Revision: 1713842

URL: http://svn.apache.org/viewvc?rev=1713842&view=rev
Log:
#3630 - JMS Publisher : reload file content if file name changes
#3630

Modified:
jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/PublisherSampler.java
jmeter/trunk/xdocs/changes.xml
jmeter/trunk/xdocs/usermanual/component_reference.xml

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
Thanks for contribution, it was partly rewritten.

It would be nice to have feedback on nightly build (available tomorrow) to see if everything works fine.
http://jmeter.apache.org/nightly.html
Download the _bin and _lib files
Unpack the archives into the same directory structure
The other archives are not needed to run JMeter.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant