[jboss-jira] [JBoss JIRA] Updated: (JBMESSAGING-1131) Add configuration for Remoting servlet transport

Howard Gao (JIRA) jira-events at lists.jboss.org
Mon Dec 29 08:01:56 EST 2008


     [ https://jira.jboss.org/jira/browse/JBMESSAGING-1131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard Gao updated JBMESSAGING-1131:
------------------------------------

    Attachment: code_changes.zip


in jboss remoting (version 2.2.2.SP10): ServletServerInvoker.processRequest(HttpServletRequest request, byte[] requestByte,
                                HttpServletResponse response)

I added the following line (see line 285 of ServletServerInvoker.java) :

         invocationResponse = new InvocationResponse(invocationRequest.getSessionId(),
                                                    invocationResponse, isError, responseMap);

I did this because I saw http invoker did this : see (line 368 ~ 373 of CoyoteInvoker.java)

            if (isRemotingUserAgent && ((Boolean)receivedInvocationRequest.get()).booleanValue())

            {

               responseMap = ((ResponseMap) responseMap).getMap();

               responseObject = new InvocationResponse(invocationRequest.getSessionId(),

                                                       responseObject, isError, responseMap);

            }



In JBoss Messaging 1.4, JMSWireFormat.java, I added the following line: (line 342, the read() method)

      int id ;
      try
      {
         id = dis.readInt();
      } catch (EOFException e) {
         System.err.println("Someting wrong? **********************************************");
         return null;
      }

I added this because I found in the example the jms server will receive an empty ByteArrayInputStream and will cause the following packet.read(dis) to fail (EOFException).

With the above changes, I can successfully run the servlet example as well as http example. 

I need JBoss Remoting guy to help review the code, and see if the changes are valid. 



> Add configuration for Remoting servlet transport
> ------------------------------------------------
>
>                 Key: JBMESSAGING-1131
>                 URL: https://jira.jboss.org/jira/browse/JBMESSAGING-1131
>             Project: JBoss Messaging
>          Issue Type: Task
>            Reporter: Ron Sigal
>            Assignee: Howard Gao
>             Fix For: 1.4.0.SP3.CP05
>
>         Attachments: build.xml, code_changes.zip, messaging-servlet-service.xml, remoting-servlet-service.xml, ServletExample.java, web.xml
>
>
> In addition to the "http" transport, Remoting also has the http-based "servlet" transport.  The servlet transport is the same as the http transport on the client side (they both use org.jboss.remoting.transport.http.HTTPClientInvokr), but they are different on the server side.  In particular, CoyoteInvoker, the http transport server invoker, uses the network layer of tomcat/jbossweb, i.e., a ServerSocket with worker threads.  But in the servlet transport, a org.jboss.remoting.transport.servlet.web.ServerInvokerServlet fields invocations and passes them to org.jboss.remoting.transport.servlet.ServletServerInvoker.  The advantage, which came up in a forum thread recently (http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4098850#4098850  and http://www.jboss.com/index.html?module=bb&op=viewtopic&t=122218 ), is that only one ServerSocket is used.  In principle, it's the appropriate transport to use when the server is running inside JBossAS.  In fact, the wiki page "Accessing_EJB3s_over_HTTP_HTTPS" shows how to change the EJB3 transport from socket to servlet.  However, there have been a couple of problems.  For one, ServletServerInvoker has been a little behind CoyoteInvoker in its development, though I've been rectifying that (JBREM-675 "Problems with Servlet invoker").  For another, the servlet transport needs tomcat/jbossweb for unit testing, and we've never automated that, so it's not as well tested as CoyoteInvoker (JBREM-139 "need automated test for servlet server invoker").  However, I wanted to verify that JBossMessaging can run with the servlet transport, so I created a servlet example, parallel to the http example, along with the supporting configuration files, and it works. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       




More information about the jboss-jira mailing list