问题
I need to migrate a http NoSessionConnector defined in mule 3.3.1 in this way:
<http:connector name="NoSessionConnector">
<service-overrides sessionHandler="org.mule.session.NullSessionHandler" />
</http:connector>
to the new http:listener-config but I cannot put service-overrides inside http:listener-config tag nor inside http:listener tag. Both configurations are not permitted:
<http:listener-config name="httpListener" host="localhost">
<service-overrides sessionHandler="org.mule.session.NullSessionHandler" />
</http:listener-config>
<http:listener config-ref="httpListener" path="/ecommerce/*">
<service-overrides sessionHandler="org.mule.session.NullSessionHandler" />
</http:listener>
is there a way to configure a custom sessionHandler in mule 3.7.0? I need it to avoid a OptionalDataException as described on this stackoverflow
回答1:
If the problem is the message property "MULE_SESSION" that is past as HTTP header, then you can try removing it from the outbound scope of the message in order to avoid sending "MULE_SESSION" as HTTP header. You can do it by using the "message-property-transformer" element:
<message-properties-transformer scope="outbound">
<delete-message-property key="MULE_SESSION" />
</message-properties-transformer>
Remember that you have to place it before the SOAP call in the flow.
来源:https://stackoverflow.com/questions/33041725/override-sessionhandler-using-httplistener-config