Announcement Announcement Module
Collapse
No announcement yet.
How to add request-handler-advice-chain into smpp outbound gateway Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 ?

  • #2
    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.

    Comment


    • #3
      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().

      Comment


      • #4
        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, 11:20 PM.

        Comment

        Working...
        X