Announcement Announcement Module
Collapse
No announcement yet.
How do I configure incoming requests to be strings? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I configure incoming requests to be strings?

    I have a basic Spring Integration-ws inbound gateway, that uses UriEndpointMappings to direct the incoming SOAP messages to channels. Right now those messages show up as DOMSource objects. Is there a way to configure the inbound-gateway to treat the requests as strings?

    here is the application context code the gateway tosses the message onto the channel that I then routed to stdout, which tells me it is a DOMSource object. Since the end goal is to simply put the incoming message directly onto an outgoing JMS queue, I need it to be treated as a string.

    Code:
        <bean class="org.springframework.ws.server.endpoint.mapping.UriEndpointMapping">
            <property name="mappings">
                <props>
                    <prop key="${my.data.url}">dataGateway</prop>
                </props>
            </property>
        </bean>
    
        <si:channel id="dataArrivedChannel" />
        <si-ws:inbound-gateway id="dataGateway" request-channel="dataArrivedChannel" />
      <stream:stdout-channel-adapter id="stdoutAdaptorWithDefaultCharsetDataArrived" channel="dataArrivedChannel"/>
    For the time being I have a transformer to convert from DOMSource to string, but with millions of messages coming through over a short period of time, I really can't afford the time for the conversion if there is a way to have spring treat the incoming request as a string.

    Thanks for your help!

  • #2
    I am guessing since no one has responded, that there is no way to configure the channel to represent it's payload as a string. I have had to write two convertors now just to get to a String. Once for the case mentioned above, and once for an incoming WebLogic JMS queue, it was represented as a byte[] which had to be converted to string to perform the Marshalling. I think this would be a very good enhancement for Spring Integration for future release. I have talked with some other SI developers, and they have all had issues with this exact same thing. The transformer's aren't hard to write, but for my case above, I don't even need it to be a DOMSource object, as I never look at it, just need to place it on an outgoing JMS Queue to be processed downstream. With millions of messages a day, it's too much of performance hit to convert, transform, etc several times.

    Can someone on the Spring Integration team add an enhancement request for this?

    Comment


    • #3
      Phlip

      You can open an enhancement request in JIRA yourself In fact that would ba a preferred way.

      But before you do that you can also try to register native Spring WS EndpointInterceptor.

      Also I have a question: What do you mean when you say- "to treat the requests as strings". It comes in as Source from WS so someone has to convert it back to String, right?

      Comment


      • #4
        Thanks for your reply Oleg.

        The inbound Gateway places the SOAP Message onto the channel, already converted to a Java DOMSource object. What I really needed was a way to configure the inbound gateway to treat the incoming SOAP request, even though it is XML, as a string and place a string on the channel. Then I could have connected that channel directly to the outgoing JMS queue. It would have saved converting to DomSource -> then back to String. Because of the quantity, I need to just received the messages as fast as possible and pass downstream to process.

        I will have to take a look at the EndpointInterceptor, still fairly new to Spring Integration.

        Comment

        Working...
        X