The HttpConnector really use an InoOnly when configured to do so (as you did). What I said is that the request is not send asynchronously using a DeliveryChannel.send, but rather
synchronously using a DeliveryChannel.sendSync method.
One of the reason is that the NormalizedMessage content is set to a StreamSource that target the http request input stream, so that no buffering occurs. If you really want an asynchronous send, the sendSync call must be changed to a send call (only for InOnly), but in these cases, the input stream has to be read so that the stream is not closed when the message is processed by the target component.

Cheers,
Guillaume Nodet

Schweter, Ryan wrote:

I'm sending in a test xml document:

<test id="1" />

So are you saying that the HttpConnector doesn't truly support InOnly at
the moment?  I don't have any issues updating the class, just wanted to
make sure I understood you.

-----Original Message-----
From: Guillaume Nodet [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 25, 2006 11:37 AM
To: [email protected]
Subject: Re: [servicemix-user] ServiceMix Design Questions

What do you send in your POST request ? You should have a valid xml ...
Also, for the reason you pointed, the HttpConnector and related components do use synchronous send even for in-only.
Thus, there is no need to copy the message from the http request, as the

input stream will be parsed directly.

You should patch the HttpInOutBinding to add a flag to use asynchronous sends when in only, and send the exchange asynchronously (after having copied the content).

Cheers,
Guillaume Nodet

Schweter, Ryan wrote:

I tried this simple example of how I think you setup an In-Only HTTP
endpoint (notice the defaultInOut = false.  When I post a message to
the
endpoint it returns immediately (good), but then throws a socket
exception on the server (bad).  My guess is that the FileWriter is
trying to use the socket stream that is obviously no longer valid.
Seems  like the InOnly HTTP connector should pull out all of the POST
and save it in the message instead of using a socket stream.

Have I done something wrong?

-----------------------------------------------------------------------
-
-------------------------
CONFIG:

<sm:activationSpec componentName="httpReceiver2"
service="brw:httpBinding2" endpoint="httpReceiver"
destinationService="brw:fileSender">
        <sm:component>
                <bean xmlns="http://xbean.org/schemas/spring/1.0";
class="org.servicemix.components.http.HttpConnector">
                        <property name="host" value="localhost"/>
                        <property name="port" value="8913"/>
                        <property name="defaultInOut" value="false"/>
                </bean>
        </sm:component>
</sm:activationSpec>                      

<sm:activationSpec componentName="fileSender" service="brw:fileSender">
        <sm:component>
                <bean class="org.servicemix.components.file.FileWriter">
                        <property name="directory" value="c:\blah"/>

                        <property name="marshaler">
                                <bean
class="org.servicemix.components.util.DefaultFileMarshaler">
                                        <property name="fileName">
                                                <bean
class="org.servicemix.expression.JaxenStringXPathExpression">
                                                        <constructor-arg
value="concat('sample_', //@id, '.xml')"/>
                                                </bean>
                                        </property>
                                </bean>
                        </property>
                </bean>
        </sm:component>
</sm:activationSpec>
-----------------------------------------------------------------------
-
-------------------------

-----------------------------------------------------------------------
-
-------------------------
EXCEPTION:

javax.jbi.messaging.MessagingException: java.net.SocketException:
Software caused connection abort: recv failed
      at
org.servicemix.expression.JaxenXPathExpression.evaluate(JaxenXPathExpre
s
sion.java:106)
      at
org.servicemix.components.util.DefaultFileMarshaler.getOutputName(Defau
l
tFileMarshaler.java:65)
      at
org.servicemix.components.file.FileWriter.process(FileWriter.java:114)
      at
org.servicemix.components.util.OutBinding.onMessageExchange(OutBinding.
j
ava:51)
      at
org.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(Deliver
y
ChannelImpl.java:588)
      at
org.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:17
1
)
      at
org.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:225)
      at
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java
:
291)
      at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
Source)
      at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.SocketException: Software caused connection abort:
recv failed
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at org.mortbay.util.LineInput.fill(LineInput.java:434)
      at org.mortbay.util.LineInput.read(LineInput.java:293)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at org.mortbay.jetty.servlet.ServletIn.read(ServletIn.java:27)
      at
org.apache.xerces.impl.XMLEntityManager$RewindableInputStream.read(Unkn
o
wn Source)
      at
org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown
Source)
      at
org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown
Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
Source)
      at
javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:123)
      at
org.servicemix.jbi.jaxp.SourceTransformer.toDOMSourceFromStream(SourceT
r
ansformer.java:213)
      at
org.servicemix.jbi.jaxp.SourceTransformer.toDOMSource(SourceTransformer
.
java:136)
      at
org.servicemix.jbi.jaxp.SourceTransformer.toDOMNode(SourceTransformer.j
a
va:249)
      at
org.servicemix.jbi.jaxp.SourceTransformer.toDOMNode(SourceTransformer.j
a
va:276)
      at
org.servicemix.expression.JaxenXPathExpression.getXMLNode(JaxenXPathExp
r
ession.java:210)
      at
org.servicemix.expression.JaxenXPathExpression.evaluate(JaxenXPathExpre
s
sion.java:86)
-----------------------------------------------------------------------
-
-------------------------


-----Original Message-----
From: Guillaume Nodet [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 25, 2006 10:09 AM
To: [email protected]
Subject: Re: [servicemix-user] ServiceMix Design Questions

The request / response should be handled by a synchronous in-out mep on

the binding component.
The asynchronous one should use an asynchronous in-only mep.

Cheers,
Guillaume Nodet

Schweter, Ryan wrote:



I've recently gotten back into ServiceMix and am setting up a messaging infrastructure for published application events. I want to have two HTTP entry points into the message bus: one that will synchronously return a success/fail response (regarding schema validation and whatnot) and one that immediately returns (fire and forget). As mentioned, on the synchronous endpoint I want to return a response to the client, then work asynchronously (from a client perspective) while routing/translating the event.

What is the best way to get the functionality I want?


*______________________________________________________________________
_
_______________**


***Ryan Schweter**** ***
*Architect / Developer
IT Systems Architecture
Broadwing Communications, LLC

.: 512.742.7875
.: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>










Reply via email to