You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2012/03/18 12:07:22 UTC

DO NOT REPLY [Bug 52936] New: [PATCH] Sending of JMS Object Messages from JMS Publisher throws exception

https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

             Bug #: 52936
           Summary: [PATCH] Sending of JMS Object Messages from JMS
                    Publisher throws exception
           Product: JMeter
           Version: 2.6
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Main
        AssignedTo: issues@jmeter.apache.org
        ReportedBy: miel.donkers@codecentric.nl
    Classification: Unclassified


Created attachment 28484
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28484
Patch file for Object Message enhancement

Hi,

The current implementation of JMS Publisher does not support sending of Object
Messages, simply an exception is thrown.

The supplied patch fixes this issue and allows the loading of a serialized
object from file, and send it as the body of an JMS Object Message.

Some small code cleanup is also included, but provides no additional
functionality.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

Miel Donkers <mi...@codecentric.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #28510|0                           |1
        is obsolete|                            |

--- Comment #13 from Miel Donkers <mi...@codecentric.nl> ---
Created attachment 28713
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28713&action=edit
Patch for loading object and deserialize with XStream. Load from file or from
text-area

This new patch replaces the previous one about object loading.
It is now also possible to copy-paste XML into the JMeter text-area, which will
be transformed by XStream and used for the JMS Object Message body.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

--- Comment #14 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Date: Thu May  3 13:49:55 2012
New Revision: 1333460

URL: http://svn.apache.org/viewvc?rev=1333460&view=rev
Log:
Bug 52936 - JMS Publisher : Support sending of JMS Object Messages

Modified:
   jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
   jmeter/trunk/src/core/org/apache/jmeter/resources/messages_es.properties
   jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
   jmeter/trunk/src/core/org/apache/jmeter/resources/messages_pt_BR.properties
   jmeter/trunk/src/core/org/apache/jmeter/resources/messages_tr.properties
   jmeter/trunk/src/core/org/apache/jmeter/resources/messages_zh_TW.properties
  
jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java
  
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

-- 
You are receiving this mail because:
You are the assignee for the bug.

DO NOT REPLY [Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |53129

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om
            Summary|[PATCH] Sending of JMS      |JMS Publisher : Support
                   |Object Messages from JMS    |sending of JMS Object
                   |Publisher throws exception  |Messages

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

--- Comment #16 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Created attachment 28715
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28715&action=edit
Sample Plan used for testing, it serializes JMeter Thread Group

Code used for serialization:

public class SerializeWithXStream {

    public static void main(String[] args) {
        ThreadGroup threadGroup = new ThreadGroup();
        threadGroup.setComment("comment");
        threadGroup.setDelay(123);
        threadGroup.setDuration(456);
        threadGroup.setName("TG-1");
        threadGroup.setNumThreads(5);
        threadGroup.setRampUp(600);
        threadGroup.setStartTime(111111111);
        XStream xstream = new XStream();
        String xml = xstream.toXML(threadGroup);
        System.out.println(xml);
    }
}

-- 
You are receiving this mail because:
You are the assignee for the bug.

DO NOT REPLY [Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

Miel Donkers <mi...@codecentric.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #28484|0                           |1
        is obsolete|                            |

--- Comment #3 from Miel Donkers <mi...@codecentric.nl> 2012-03-27 15:24:24 UTC ---
Created attachment 28510
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28510
Patch for loading object and deserialize with XStream

Refactored the previous solution. Now uses XStream to load an (XML) object,
which is deserialized so it can be send as JMS Object Message body.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Philippe Mouawad <p....@ubik-ingenierie.com> 2012-03-18 21:08:09 UTC ---
Hello,
Thanks for your patch submission.
Reviewing it I have a little issue with it, currently how do you make the
content variable ?
Wouldn't be a better solution to unmarshall the java Object from an XML
structure using XStream, which would make it easier to variabilize the content
?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

--- Comment #5 from Miel Donkers <mi...@codecentric.nl> 2012-04-02 14:04:33 UTC ---
Created attachment 28528
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28528
Supplementary patch to get XStream working

Patch file adds XMLPull library to the project, so that XStream works again.
The newer version of XStream tries to use a XMLPullFactory, which was not
included.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

--- Comment #2 from Miel Donkers <mi...@codecentric.nl> 2012-03-19 08:07:51 UTC ---
Thanks for your feedback. To be honest I did not think of this solution.
I will change the implementation to use XStream. And also make sure that the
XML can be pasted in the text-field and as such the Object Message can be sent.
After the changes are made I will supply a new patch.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #15 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Thanks for the patch.
Applied with following changes:
- Removed popup that triggered when TextArea as source was select and Object
Type Radio was selected
- Removed useless messages from resources
- Modified label of Text area as its content can also be used by Object
Messages
- Changed instance methods to static
- Updated component_reference.xml

-- 
You are receiving this mail because:
You are the assignee for the bug.

DO NOT REPLY [Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

Bug 52936 depends on bug 53129, which changed state.

Bug 53129 Summary: Upgrade XStream from 1.3.1 to 1.4.2
https://issues.apache.org/bugzilla/show_bug.cgi?id=53129

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

--- Comment #9 from Sebb <se...@apache.org> 2012-04-24 23:35:42 UTC ---
Seems to me it would be best if the object could be derived either from a file
or from the screen.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

--- Comment #11 from Sebb <se...@apache.org> 2012-04-25 08:56:47 UTC ---
(In reply to comment #10)
> Hello,
> What do you mean dérived from screen ? 
> What i havé in mind is to use current  textarea

That's what I meant.

> And if object is sélected as type then déserialize from XML .
> This would allow easy variabilization of object properties.

Yes.

> Another way would be to enable getting an object from jmeter context
> (so name of object should be input) and a beanshell sampler would havé
> Set it before.

But neither is good for large (fixed) objects, which is why it would be useful
to be able to read the XML from a file.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

Miel Donkers <mi...@codecentric.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #6 from Miel Donkers <mi...@codecentric.nl> 2012-04-02 14:05:28 UTC ---
See patches. Together these should implement the requested enhancement.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

--- Comment #10 from Philippe Mouawad <p....@ubik-ingenierie.com> 2012-04-25 06:17:39 UTC ---
Hello,
What do you mean dérived from screen ? 
What i havé in mind is to use current  textarea
And if object is sélected as type then déserialize from XML .
This would allow easy variabilization of object properties.
Another way would be to enable getting an object from jmeter context
(so name of object should be input) and a beanshell sampler would havé
Set it before.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

--- Comment #4 from Miel Donkers <mi...@codecentric.nl> 2012-03-27 15:34:29 UTC ---
Hi,

I updated the solution to use XStream to deserialize an object from XML.

There is one problem however; to correctly deserialize our objects (which
include Joda time) we need the latest version of XStream library (1.4.2).
I already updated this dependency version. However between 1.3.x and 1.4.x a
change was made to use dynamic loading of a XML Pull Parser. For this, XStream
expects a XMLPullParserFactory to be on its path. So still the supplied code
and the JMeter test set is failing.

The XMLPullParserFactory is not included in the Xpp3 dependency. There are two
solutions;
- Either tell XStream to explicitly use the Xpp3Driver
- Put a dependency on the path including the XMLPullParserFactory. For example
xmlpull-1.1.3.1.jar or kXML2

The first solution introduces quite some work, but for the second solution I
don't know which library would be preferred.

Please let me know if there are other questions.

I'll make a separate patch to also be able to paste the XML object into the
text field and send it as object as such.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

--- Comment #8 from Philippe Mouawad <p....@ubik-ingenierie.com> 2012-04-24 21:41:59 UTC ---
I have reviewed the patch and there are still some things to change.

My main concern is that as implemented in fact it loads Java Object  as XML
from file.
This is an issue to variabilize data as data loaded from file cannot be
variabilized (see https://issues.apache.org/bugzilla/show_bug.cgi?id=15468).

So it would be better if Object serialized in XML could be loaded from TextArea
and so stored in Test Plan. This would ease a lot the variabilization and so
make patch more useful.
Another concern would be some tooling to serialize the Object to XML with
XStream from JMeter GUI, cause with current proposed patch user must write some
code in Java to serialize.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

--- Comment #7 from Philippe Mouawad <p....@ubik-ingenierie.com> 2012-04-22 19:59:10 UTC ---
Thanks, Applied partly patch for XStream.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52936] JMS Publisher : Support sending of JMS Object Messages

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52936

--- Comment #12 from Miel Donkers <mi...@codecentric.nl> 2012-04-25 09:33:04 UTC ---
Hi,

After this patch was committed, I also wanted to write a patch to (as is
suggested in the comments) to load XML from the text area. This would then
correspond with existing functionality (load message content both from text
area as well as a file). Because we need the 'loading from a file' and because
of consistency, I therefore also propose to support both options.

I understand now that it would be better to combine the two into one single
patch.   Please expect this patch here in the next couple of days...

To serialize an object into XML from within the JMeter GUI I don't yet have a
solution / proposal. We are using our own 'tool' which we created specifically
for this task. This tool could be modified to be included into JMeter.
Is there already similar functionality in JMeter for a different protocol? We
could then mimic the look&feel and behaviour.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.