Results 1 to 4 of 4

Thread: How to add request-handler-advice-chain into smpp outbound gateway

  1. #1
    Join Date
    Sep 2007
    Location
    Sydney
    Posts
    18

    Default How to add request-handler-advice-chain into smpp outbound gateway

    Hi,

    I would like to know what's the best way to add 'request-handler-advice-chain' into custom outbound gateway?

    I am trying to add request-handler-advice-chain to spring-integration-smpp and have been scratching my head for a while in which I did wrong. I copied the xml schema from spring-integration-http and my test works that the outbound gateway can recognize the advice I put in, but it seems like it is not creating proxy for my gateway and applying my advice.

    My schema is similar like

    Code:
    ...
    <xsd:import namespace="http://www.springframework.org/schema/integration"
    		schemaLocation="http://www.springframework.org/schema/integration/spring-integration-2.2.xsd" />
    ...
    <xsd:element name="outbound-gateway">
       ...
       <xsd:complexType>
          <xsd:complexContent>
             <xsd:extension base="smppGatewayType">
                <xsd:choice minOccurs="0" maxOccurs="2">
                      <xsd:element minOccurs="0" maxOccurs="1" ref="session"/>
                      <xsd:element name="request-handler-advice-chain" type="integration:adviceChainType" 
                                            minOccurs="0" maxOccurs="1" />
                </xsd:choice>
       ...
    I use the same advice for http outbound gateway, i can see my advice is run on console. But for the smpp outbound gateway it looks like Spring does not wrap the outbound gateway with proxy like the way it does on http outbound gateway.

    Can you guys see something I missed during the process ?
    ---------
    otnateos
    ---------

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,025

    Default

    You should get it "for free" (after adding to the schema) because it's handled by the AbstractConsumerEndpointParser.

    Try setting a breakpoint in onInit() in AbstractReplyProducingMessageHandler - that's where the proxy is created - note that it is an internal proxy within the ARPMH, the entire bean is not proxied.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Sep 2007
    Location
    Sydney
    Posts
    18

    Default

    Quote Originally Posted by Gary Russell View Post
    Try setting a breakpoint in onInit() in AbstractReplyProducingMessageHandler - that's where the proxy is created - note that it is an internal proxy within the ARPMH, the entire bean is not proxied.
    Thanks Gary, finally you saved my day ! SmppOutboundGateway apparently override onInit() method and didn't call the super.onInit().
    ---------
    otnateos
    ---------

  4. #4
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,025

    Default

    Thanks; we should probably come up with a scheme to prevent this kind of error - such as making ARPMH.onInit() final and have it call a method such as doCustomInit() (with a NoOp in the abstract class).

    Please open an 'Improvement' JIRA.
    Last edited by Gary Russell; Mar 14th, 2013 at 11:20 PM.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •