[ 
https://issues.apache.org/activemq/browse/CAMEL-2943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61134#action_61134
 ] 

Claus Ibsen commented on CAMEL-2943:
------------------------------------

What does this code do?
{code}
  Integer.toHexString((int) (Math.random() * Integer.MAX_VALUE))
{code}

And if exceptions is thrown you catch and log them. Is this the best we can do?

Is an ACK anything but a 200?
{code}
  if (response.getStatusCode() !=  200) {
+            LOG.debug("Ack received from Subscriber");
+        }
{code}


There are a couple of places where you drop the message like this
{code}
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Stray response -- dropping ");
+            }
{code}
Maybe it should be WARN level? Or does this happen very often?
And maybe you can log a bit more about the stray response? So the end user have 
more information to track down with.

You may want to provide a better error message if a mandatory header is 
missing, as you can't see from the error message that its a header and what the 
key is for it
{code}
 ObjectHelper.notNull(exchange.getIn().getHeader("REQUEST_METHOD"), "Request 
Method");
{code}

Instead of type casting use the Camel API for that
{code}
String requestMethod = (String) exchange.getIn().getHeader("REQUEST_METHOD");
{code}
Should just be
{code}
String requestMethod = exchange.getIn().getHeader("REQUEST_METHOD", 
String.class);
{code}


Should the doStop method in {{SipSubscriber}} be empty?


Also ensure the code is valid according to checkstyle using the mvn goal:
{code}
mvn compile -Psourcecheck
{code}

> A Camel component that implements the Telecom SIP protocol for 
> Publish/Subscribe capability... 
> -----------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2943
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2943
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Ashwin Karpe
>            Assignee: Ashwin Karpe
>         Attachments: camel-sip-20100714.zip, camel-sip.diff, jain-sip.zip
>
>
> The Telco SIP protocol has operations to perform Publish and Subscribe of 
> Telecom events via a Presence Agent (similar to a Broker) as an intermediary.
> Develop a Camel SIP Component that can communicate with a Presence Agent 
> (also add a basic Presence Agent with no persistence). The SIP Component 
> should as a consumer, subscribe to messages from a Presence Agent and support 
> the SIP protocol handshake and as a Producer publish messages to a Presence 
> Agent.
> The SIP protocol involves communication over HTTP with specific 
> acknowledgements that need to cater for different situations. This 
> communication pattern and handshake must be properly supported.

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

Reply via email to