You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "irantha suwandarathna (JIRA)" <ji...@apache.org> on 2008/11/05 08:59:44 UTC

[jira] Created: (SYNAPSE-478) Synapse exceptions with JBossMQ

Synapse exceptions with JBossMQ
-------------------------------

                 Key: SYNAPSE-478
                 URL: https://issues.apache.org/jira/browse/SYNAPSE-478
             Project: Synapse
          Issue Type: Bug
          Components: Transports
    Affects Versions: 1.2
         Environment: JBoss  4.2.3GA
            Reporter: irantha suwandarathna


JBossMQ SpyMessage (javax.jms.Message instance) throw exceptions for ( JMSXDeliveryCount, JMS_DESTINATION, JMS_JBOSS_REDELIVERY_COUNT, 
JMS_REDELIVERED ) properties set inside JMSUtils.setTransportHeaders method.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (SYNAPSE-478) Synapse exceptions with JBossMQ

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645173#action_12645173 ] 

Andreas Veithen commented on SYNAPSE-478:
-----------------------------------------

See also http://markmail.org/message/av7d7aors7ew5zc6

> Synapse exceptions with JBossMQ
> -------------------------------
>
>                 Key: SYNAPSE-478
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-478
>             Project: Synapse
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 1.2
>         Environment: JBoss  4.2.3GA
>            Reporter: irantha suwandarathna
>            Assignee: Andreas Veithen
>
> JBossMQ SpyMessage (javax.jms.Message instance) throw exceptions for ( JMSXDeliveryCount, JMS_DESTINATION, JMS_JBOSS_REDELIVERY_COUNT, 
> JMS_REDELIVERED ) properties set inside JMSUtils.setTransportHeaders method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (SYNAPSE-478) Synapse exceptions with JBossMQ

Posted by "Asankha C. Perera (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645201#action_12645201 ] 

Asankha C. Perera commented on SYNAPSE-478:
-------------------------------------------

Hi Irantha

Since this is your first patch, let me point you to: http://cwiki.apache.org/synapse/developer-guidelines.html 

Some initial feedback on coding style and logic:

1) Use proper Javadocs : "A JMS header field names need to confirm to java variable naming specs. "Content-Type" is illigel" 

2) Leave spaces between "try {", "catch (Exception ex){", "if(contentType.." etc.. also we keep the catch block on the same line as the "}" which closes the try block

+                    try{
+                        contentType = JMSUtils.getProperty(message, BaseConstants.CONTENT_TYPE);
+                         if(contentType == null)
+                                contentType = JMSUtils.getProperty(message, JMSConstants.JMS_CONTENT_TYPE);
+                    }
+                    catch(Exception ex){
+                         contentType = JMSUtils.getProperty(message, JMSConstants.JMS_CONTENT_TYPE);
+                    }

3) w.r.t. above, the try block will not throw an exception - since the method JMSUtils.getProperty() returns null hiding a possible JMSException
4) Anyway, generally catch only what you handle.. w.r.t. the above, catching "Exception" should not be performed, if the block only would through a JMSException (this is not the case here - but is a general comment)

+        OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext);
+        MessageFormatter messageFormatter = null;
+        try {
+            messageFormatter = TransportUtils.getMessageFormatter(msgContext);
+        } catch (AxisFault axisFault) {
+            throw new JMSException("Unable to get the message formatter to use");
+        }

5) Why would you catch an AxisFault, and throw a JMSException? The JMSException is a from javax.jms package, and we as an application should not be throwing JMSExceptions for application level faults

-                getFirstChildWithName(BaseConstants.DEFAULT_BINARY_WRAPPER);
+                    getFirstChildWithName(BaseConstants.DEFAULT_BINARY_WRAPPER);

-                            BaseConstants.DEFAULT_BINARY_WRAPPER, e);
+                                BaseConstants.DEFAULT_BINARY_WRAPPER, e);

6) Check if your IDE is set to use 4 spaces instead of tab character - also, for continuation, we use 4 tabs in general. At the same time, ensure that your IDE does not change untouched lines or the line break for files (i.e. turn off stip trailing spaces option)

+        try{
+            message.setStringProperty(BaseConstants.CONTENT_TYPE, contentType);
+        }
+        catch(Exception ex){
+            message.setStringProperty(JMSConstants.JMS_CONTENT_TYPE, contentType);
+        }

7) Consider comment #2 and #4

+               try{
...
+               }
+               catch(Exception ignore){}

8) Comment # 2

asankha


> Synapse exceptions with JBossMQ
> -------------------------------
>
>                 Key: SYNAPSE-478
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-478
>             Project: Synapse
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 1.2
>         Environment: JBoss  4.2.3GA
>            Reporter: irantha suwandarathna
>            Assignee: Andreas Veithen
>         Attachments: commons_jms.patch
>
>
> JBossMQ SpyMessage (javax.jms.Message instance) throw exceptions for ( JMSXDeliveryCount, JMS_DESTINATION, JMS_JBOSS_REDELIVERY_COUNT, 
> JMS_REDELIVERED ) properties set inside JMSUtils.setTransportHeaders method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (SYNAPSE-478) Synapse exceptions with JBossMQ

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen updated SYNAPSE-478:
------------------------------------

    Priority: Minor  (was: Major)

> Synapse exceptions with JBossMQ
> -------------------------------
>
>                 Key: SYNAPSE-478
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-478
>             Project: Synapse
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 1.2
>         Environment: JBoss  4.2.3GA
>            Reporter: irantha suwandarathna
>            Assignee: Andreas Veithen
>            Priority: Minor
>         Attachments: commons_jms.patch, commons_jms.patch
>
>
> JBossMQ SpyMessage (javax.jms.Message instance) throw exceptions for ( JMSXDeliveryCount, JMS_DESTINATION, JMS_JBOSS_REDELIVERY_COUNT, 
> JMS_REDELIVERED ) properties set inside JMSUtils.setTransportHeaders method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Resolved: (SYNAPSE-478) Synapse exceptions with JBossMQ

Posted by "Asankha C. Perera (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Asankha C. Perera resolved SYNAPSE-478.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3
         Assignee: Asankha C. Perera  (was: Andreas Veithen)

The JMS specs we support (1.0.2b and 1.1) both describe only JMSXGroupID and JMSXGroupSeq as the JMSX headers settable by a client. Thus we do not set any other JMSX headers on the message.

> Synapse exceptions with JBossMQ
> -------------------------------
>
>                 Key: SYNAPSE-478
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-478
>             Project: Synapse
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 1.2
>         Environment: JBoss  4.2.3GA
>            Reporter: irantha suwandarathna
>            Assignee: Asankha C. Perera
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: commons_jms.patch, commons_jms.patch
>
>
> JBossMQ SpyMessage (javax.jms.Message instance) throw exceptions for ( JMSXDeliveryCount, JMS_DESTINATION, JMS_JBOSS_REDELIVERY_COUNT, 
> JMS_REDELIVERED ) properties set inside JMSUtils.setTransportHeaders method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Assigned: (SYNAPSE-478) Synapse exceptions with JBossMQ

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen reassigned SYNAPSE-478:
---------------------------------------

    Assignee: Andreas Veithen

> Synapse exceptions with JBossMQ
> -------------------------------
>
>                 Key: SYNAPSE-478
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-478
>             Project: Synapse
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 1.2
>         Environment: JBoss  4.2.3GA
>            Reporter: irantha suwandarathna
>            Assignee: Andreas Veithen
>
> JBossMQ SpyMessage (javax.jms.Message instance) throw exceptions for ( JMSXDeliveryCount, JMS_DESTINATION, JMS_JBOSS_REDELIVERY_COUNT, 
> JMS_REDELIVERED ) properties set inside JMSUtils.setTransportHeaders method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (SYNAPSE-478) Synapse exceptions with JBossMQ

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646127#action_12646127 ] 

Andreas Veithen commented on SYNAPSE-478:
-----------------------------------------

I had a closer look at the JMS specs and it appears that whether a message property starting with JMSX or JMS_ is settable or not depends on the JMS provider. I think that in the case where such a transport header is set explicitly set (in client code or in a Synapse mediation), the user would expect that the transport raises an error if the property is not settable. Therefore I believe that simply ignoring exceptions thrown by Message#setXxxProperty is not a valid approach.

Actually, I believe that the real problem here is that in a proxy service, Synapse by default copies the transport headers from the incoming to the outgoing message (even if different transports are used!). I remember that recently other users reported problems that were related to this. In general the default behavior easily leads to unexpected results and is highly confusing for users not familiar with the internals of Synapse and the transports.

Note: Since there is a valid workaround for this issue (which is to explicitly remove the transport headers causing the problem), I will lower its priority.

> Synapse exceptions with JBossMQ
> -------------------------------
>
>                 Key: SYNAPSE-478
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-478
>             Project: Synapse
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 1.2
>         Environment: JBoss  4.2.3GA
>            Reporter: irantha suwandarathna
>            Assignee: Andreas Veithen
>         Attachments: commons_jms.patch, commons_jms.patch
>
>
> JBossMQ SpyMessage (javax.jms.Message instance) throw exceptions for ( JMSXDeliveryCount, JMS_DESTINATION, JMS_JBOSS_REDELIVERY_COUNT, 
> JMS_REDELIVERED ) properties set inside JMSUtils.setTransportHeaders method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (SYNAPSE-478) Synapse exceptions with JBossMQ

Posted by "irantha suwandarathna (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

irantha suwandarathna updated SYNAPSE-478:
------------------------------------------

    Attachment: commons_jms.patch

changed according to asankha ' comments.

> Synapse exceptions with JBossMQ
> -------------------------------
>
>                 Key: SYNAPSE-478
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-478
>             Project: Synapse
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 1.2
>         Environment: JBoss  4.2.3GA
>            Reporter: irantha suwandarathna
>            Assignee: Andreas Veithen
>         Attachments: commons_jms.patch, commons_jms.patch
>
>
> JBossMQ SpyMessage (javax.jms.Message instance) throw exceptions for ( JMSXDeliveryCount, JMS_DESTINATION, JMS_JBOSS_REDELIVERY_COUNT, 
> JMS_REDELIVERED ) properties set inside JMSUtils.setTransportHeaders method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (SYNAPSE-478) Synapse exceptions with JBossMQ

Posted by "irantha suwandarathna (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

irantha suwandarathna updated SYNAPSE-478:
------------------------------------------

    Attachment: commons_jms.patch

Patch for SYNAPSE-424 and SYNAPSE-478.

Piggybacked "Content-Type" on a property  named "ContentType" when former is 
not available (SYNAPSE-424). Seems ther property errors (SYNAPSE-478) can be ignored.


> Synapse exceptions with JBossMQ
> -------------------------------
>
>                 Key: SYNAPSE-478
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-478
>             Project: Synapse
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 1.2
>         Environment: JBoss  4.2.3GA
>            Reporter: irantha suwandarathna
>            Assignee: Andreas Veithen
>         Attachments: commons_jms.patch
>
>
> JBossMQ SpyMessage (javax.jms.Message instance) throw exceptions for ( JMSXDeliveryCount, JMS_DESTINATION, JMS_JBOSS_REDELIVERY_COUNT, 
> JMS_REDELIVERED ) properties set inside JMSUtils.setTransportHeaders method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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