You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2009/11/06 20:35:50 UTC

DO NOT REPLY [Bug 48155] New: Multiple problems / enhancements with JMS protocol classes.

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

           Summary: Multiple problems / enhancements with JMS protocol
                    classes.
           Product: JMeter
           Version: 2.3.4
          Platform: PC
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
        AssignedTo: jmeter-dev@jakarta.apache.org
        ReportedBy: martinrleon@yahoo.com


1. (ENHANCEMENT) Added method "getMessageHeaders()" to BaseJMSSubscriber class
to create String representation of the JMS Message Header variables.

    /**
     * Returns a String with the JMS Message Header values.
     * 
     * @param message JMS Message
     * @return String with message header values.
     */
    public static String getMessageHeaders(Message message) {
        final StringBuffer response = new StringBuffer(256);
        try {
            response.append("JMS Message Header Attributes:");
            response.append("\n   Correlation ID: ");
            response.append(message.getJMSCorrelationID());

            response.append("\n   Delivery Mode: ");
            if (message.getJMSDeliveryMode() == DeliveryMode.PERSISTENT) {
                response.append("PERSISTENT");
            } else {
                response.append("NON-PERSISTENT");
            }

            final Destination destination = message.getJMSDestination();

            response.append("\n   Destination: ");
            response.append((destination == null ? null : destination
                .toString()));

            response.append("\n   Expiration: ");
            response.append(new Date(message.getJMSExpiration()));

            response.append("\n   Message ID: ");
            response.append(message.getJMSMessageID());

            response.append("\n   Priority: ");
            response.append(message.getJMSPriority());

            response.append("\n   Redelivered: ");
            response.append(message.getJMSRedelivered());

            final Destination replyTo = message.getJMSReplyTo();
            response.append("\n   Reply to: ");
            response.append((replyTo == null ? null : replyTo.toString()));

            response.append("\n   Timestamp: ");
            response.append(new Date(message.getJMSTimestamp()));

            response.append("\n   Type: ");
            response.append(message.getJMSType());

            response.append("\n\n");
        } catch (JMSException e) {
            e.printStackTrace();
        }
        return new String(response);
    }

2. (DEFECT) SubscriberSampler.sampleWithListener() does not call

   result.setDataType(SampleResult.TEXT);

so the result data is not displayed in the Response Data pane.

3. (DEFECT) Same problem exists with SubscriberSampler.sampleWithReceive() 

4. (ENHANCEMENT) Add call getMessageHeaders() to SubscriberSampler.onMessage()
so that JMS Message Header info can be displayed in Response Data pane:

   this.BUFFER.append(getMessageHeaders(message));
   this.BUFFER.append("JMS Message Text:\n\n");
   this.BUFFER.append(content);

5. (DEFECT) ReceiveSubscriber() constructor is using mix of local and instance
variable to try to create TopicSession and TopicSubscriber resulting in NPE. 
Use the instance variables instead, remove the local variables.

6. (ENHANCEMENT) modify ReceiveSubscriber.run() to add JMS Header to data
buffer:

   synchronized (this) {
      this.buffer.append(BaseJMSSampler.getMessageHeaders(message));
      this.buffer.append("JMS Message Text:\n\n");
      this.buffer.append(text);
      count(1);
   }

7 (DEFECT) PublisherSampler.sample() is missing call to
result.setDataType(SampleResult.TEXT) and add calls to set the Request Data and
Result values:

    public SampleResult sample() {
        SampleResult result = new SampleResult();

        // REQUIRED TO DISPLAY IN REQEST / RESPONSE PANES
        result.setDataType(SampleResult.TEXT);
        result.setSampleLabel(getName());
        if (this.PUB == null) {
            this.initClient();
        }
        int loop = this.getIterationCount();
        if (this.PUB != null) {
            result.sampleStart();
            for (int idx = 0; idx < loop; idx++) {
                String tmsg = this.getMessageContent();
                this.PUB.publish(tmsg);
                this.BUFFER.append(tmsg);
            }
            result.sampleEnd();
            String content = this.BUFFER.toString();
            result.setBytes(content.getBytes().length);
            result.setResponseCode("message published successfully");
            result.setResponseMessage(loop + " messages published");
            result.setSuccessful(true);
            // SET RESPONSE PANE DATA TO N/A
            result.setResponseData("Not Applicable".getBytes());
            // SET REQUEST PANE DATA
            result.setSamplerData(content);
            result.setSampleCount(loop);
            this.BUFFER.setLength(0);
        }
        return result;
    }

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

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 48155] Multiple problems / enhancements with JMS protocol classes.

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

Sebb <se...@apache.org> changed:

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

--- Comment #6 from Sebb <se...@apache.org> 2009-11-13 18:50:47 UTC ---
(In reply to comment #5)
> I re-read your response, what is a "unified different format"?  Can you point
> me to a URL explaining how to do this?

http://www.apache.org/dev/contributors.html#patches

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

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 48155] Multiple problems / enhancements with JMS protocol classes.

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

--- Comment #4 from martinrl <ma...@yahoo.com> 2009-11-13 17:13:50 UTC ---
Created an attachment (id=24531)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24531)
Patches with original source

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

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 48155] Multiple problems / enhancements with JMS protocol classes.

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

--- Comment #10 from martinrl <ma...@yahoo.com> 2009-12-09 14:43:21 UTC ---
Is there anything else I need to do to get this patch to be in an acceptable
format?

(In reply to comment #8)
> (In reply to comment #7)
> > Created an attachment (id=24532)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24532) [details]
[details]
> > Proposed patches
> > 
> > Thanks for guide on patches.  Here's the resulting patch file.
> 
> Unfortunately the patch appears to have been made by comparing your version
> against the current code in trunk. As your changes were not made to the current
> code, this means that several recent changes would be lost if the patches were
> applied.
> 
> What's needed is a patch file showing exactly what you changed, i.e. the
> changes need to be against whatever you started with, which I think was 2.3.4?
> 
> Alternatively, redo your changes to the current code in trunk, and produce a
> new patch for that.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 48155] Multiple problems / enhancements with JMS protocol classes.

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

Sebb <se...@apache.org> changed:

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

--- Comment #2 from Sebb <se...@apache.org> 2009-11-13 14:41:29 UTC ---
Thanks for the suggestions.

Unfortunately they cannot be applied as they stand, as the source code has
changed, and the changes are provided as full source files which no longer
provide sensible differences.

Please can you provide the changes as patches in unified difference format?

Ideally against the current version in SVN, but even differences from the
source you based your changes on would probably be OK.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 48155] Multiple problems / enhancements with JMS protocol classes.

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

martinrl <ma...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major

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

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 48155] Multiple problems / enhancements with JMS protocol classes.

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

--- Comment #1 from martinrl <ma...@yahoo.com> 2009-11-06 19:19:13 UTC ---
Created an attachment (id=24503)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24503)
Proposed patches

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

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 48155] Multiple problems / enhancements with JMS protocol classes.

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

--- Comment #5 from martinrl <ma...@yahoo.com> 2009-11-13 17:23:00 UTC ---
I re-read your response, what is a "unified different format"?  Can you point
me to a URL explaining how to do this?

The files I provided can be "diff"d against each other.  They are the original
2.3.4 source and the fixed source files.

Please let me know if you want me to do something different.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 48155] Multiple problems / enhancements with JMS protocol classes.

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

Sebb <se...@apache.org> changed:

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

--- Comment #8 from Sebb <se...@apache.org> 2009-11-14 14:09:36 UTC ---
(In reply to comment #7)
> Created an attachment (id=24532)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24532) [details]
> Proposed patches
> 
> Thanks for guide on patches.  Here's the resulting patch file.

Unfortunately the patch appears to have been made by comparing your version
against the current code in trunk. As your changes were not made to the current
code, this means that several recent changes would be lost if the patches were
applied.

What's needed is a patch file showing exactly what you changed, i.e. the
changes need to be against whatever you started with, which I think was 2.3.4?

Alternatively, redo your changes to the current code in trunk, and produce a
new patch for that.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 48155] Multiple problems / enhancements with JMS protocol classes.

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

--- Comment #11 from Sebb <se...@apache.org> 2009-12-10 14:58:50 UTC ---
The patch is a lot better, but still makes some unnecessary changes, for
example:

-    private final TopicConnection CONN;
+    private TopicConnection CONN = null;

and related changes in the static {} block.

It's important that the variable (and others like it) remains final, otherwise
it may not be published correctly across threads.

However, I think I can work round those changes; the other changes look OK.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 48155] Multiple problems / enhancements with JMS protocol classes.

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

martinrl <ma...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #24503|0                           |1
        is obsolete|                            |
  Attachment #24531|0                           |1
        is obsolete|                            |

--- Comment #7 from martinrl <ma...@yahoo.com> 2009-11-13 19:50:25 UTC ---
Created an attachment (id=24532)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24532)
Proposed patches

Thanks for guide on patches.  Here's the resulting patch 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.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 48155] Multiple problems / enhancements with JMS protocol classes.

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

martinrl <ma...@yahoo.com> changed:

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

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

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 48155] Multiple problems / enhancements with JMS protocol classes.

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

--- Comment #3 from martinrl <ma...@yahoo.com> 2009-11-13 17:12:23 UTC ---
I'm a newbie to submitting patch suggestions.  I am attaching a ZIP file with
the original and fixed files in separate folders.  If you need me to do more,
please let me know.  I want to contribute in whatever way I can.  Thank you for
such a great tool!  I am still learning it, but I see it as a very valuable
tool, thank you very much!

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

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 48155] Multiple problems / enhancements with JMS protocol classes.

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

--- Comment #13 from martinrl <ma...@yahoo.com> 2009-12-10 18:21:30 UTC ---
My first open source bug patch!  Woohoo!

Thanks for the free lessons.  Hopefully I'll be able to contribute more in the
future.

(In reply to comment #12)
> Applied to SVN:
> 
> URL: http://svn.apache.org/viewvc?rev=889456&view=rev
> Log:
> Bug 48155 - Multiple problems / enhancements with JMS protocol classes
> 
> I made one or two other changes, for example responseCode should be "200" for
> OK, not a text message.
> 
> The code will be in nightly builds after r889456 - please re-open the bug if
> there are any problems.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 48155] Multiple problems / enhancements with JMS protocol classes.

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

martinrl <ma...@yahoo.com> changed:

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

--- Comment #9 from martinrl <ma...@yahoo.com> 2009-11-14 15:26:49 UTC ---
Created an attachment (id=24538)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24538)
Proposed patches against current revision

One more time....  Thanks for your patience with a rookie!

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

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 48155] Multiple problems / enhancements with JMS protocol classes.

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

Sebb <se...@apache.org> changed:

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

--- Comment #12 from Sebb <se...@apache.org> 2009-12-10 15:02:47 UTC ---
Applied to SVN:

URL: http://svn.apache.org/viewvc?rev=889456&view=rev
Log:
Bug 48155 - Multiple problems / enhancements with JMS protocol classes

I made one or two other changes, for example responseCode should be "200" for
OK, not a text message.

The code will be in nightly builds after r889456 - please re-open the bug if
there are any problems.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org