4 Replies Latest reply on Sep 6, 2012 5:42 AM by sh1theng

    can i use my service to process the requerst from the <socket-binding-group> ?

    sh1theng

      can i use my service to process the requerst from the <socket-binding-group> ?

       

      i saw this in the standalone.xml.

                          <connectors>

                          <netty-connector name="netty" socket-binding="messaging"/>

                          <netty-connector name="netty-throughput" socket-binding="messaging-throughput">

                              <param key="batch-delay" value="50"/>

                          </netty-connector>

                          <in-vm-connector name="in-vm" server-id="0"/>

                      </connectors>

       

       

                      <acceptors>

                          <netty-acceptor name="netty" socket-binding="messaging"/>

                          <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">

                              <param key="batch-delay" value="50"/>

                              <param key="direct-deliver" value="false"/>

                          </netty-acceptor>

                          <in-vm-acceptor name="in-vm" server-id="0"/>

                      </acceptors>

       

      how can it be

        • 1. Re: can i use my service to process the requerst from the <socket-binding-group> ?
          jaikiran

          I'm not sure what the question is. Can you explain a bit, please?

          • 2. Re: can i use my service to process the requerst from the <socket-binding-group> ?
            sh1theng

            can i set a port 9002 in <socket-binding-group>,

            <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
                    <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
                    <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
                    <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>

             

                      <socket-binding name="myport" port="9002"/>

             

             

                    ...

                     <socket-binding name="messaging" port="5445"/>

                    <socket-binding name="messaging-throughput" port="5455"/>
                    <outbound-socket-binding name="mail-smtp">
                        <remote-destination host="localhost" port="25"/>
                    </outbound-socket-binding>
                </socket-binding-group>

            and then use my own service to listen on "myport" like the  jms subsystem  listen on port 5445

             

            i think jboss is already in an "nio" way when it's service listen on the port group.

            i want to built a socket server use jboss own nio.

            • 3. Re: can i use my service to process the requerst from the <socket-binding-group> ?
              ctomc

              Hi,

               

              yes it is absolutly possible to do that

               

              but! you would need to be in a subsystem not in user deployment.

               

              you can create extension by folowing this documentation https://docs.jboss.org/author/display/AS71/Extending+JBoss+AS+7

               

              and then when you have your own Service you can inject socketBinding into it  something like this:

               

              final ServiceBuilder<Connector> serviceBuilder = context.getServiceTarget().addService(WebSubsystemServices.JBOSS_WEB_CONNECTOR.append(name), service)

                   .addDependency(SocketBinding.JBOSS_BINDING_NAME.append(bindingRef), SocketBinding.class, service.getBinding());

              where bindingRef is name of socket-binding you have in standalone.xml

               

              hope this helps.

               

              --

              tomaz

              • 4. Re: can i use my service to process the requerst from the <socket-binding-group> ?
                sh1theng

                yes,that's what i need.

                but , i must learn how to write a subsystem first

                 

                in particular, the key code connect my handle to the socketBinding.

                thx.