camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] Commented: (CAMEL-2237) Improper ordering of MINA filters
Date Tue, 01 Dec 2009 09:33:52 GMT


Claus Ibsen commented on CAMEL-2237:

I wonder if we should invert the {{noDefaultCodec}} option as its kinda confusing to say true
to something that is no.

Maybe it should be {{useDefaultCodec=false}} and let that option be default *true*.

> Improper ordering of MINA filters
> ---------------------------------
>                 Key: CAMEL-2237
>                 URL:
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-mina
>    Affects Versions: 2.1.0
>            Reporter: Dmytro Rud
>            Assignee: Martin Krasser
>             Fix For: 2.2.0
>         Attachments: camel-mina-20091130.patch
> When we want to use SSL on the consumer side, MINA's SSLFilter must be inserted as the
very first filter into the chain (or, at least, as the second one after an {{ExecutorFilter}}),
but it is currently not possible, because {{MinaComponent#createSocketEndpoint()}} always
inserts a {{ProtocolCodecFilter}} at the very beginning by calling {{configureCodecFactory()}}.
> A proposed workaround is to introduce an additional URL parameter _noDefaultCodec_ which
prohibits the installation of the default protocol codec filter. The protocol codec must be
then configured manually, e.g. using Spring:
> {quote}
> <bean id="sslFilter" class="org.apache.mina.filter.SSLFilter">
>     <constructor-arg>
>         <bean class="" factory-method="getDefault" />
>     </constructor-arg>
> </bean>
> <bean id="codecFilter" class="org.apache.mina.filter.codec.ProtocolCodecFilter">
>     <constructor-arg ref="hl7codec" />
> </bean>
> <bean id="hl7codec" class="org.apache.camel.component.hl7.HL7MLLPCodec" />
> <bean id="minaFilters" class="java.util.ArrayList">
>     <constructor-arg>
>         <list value-type="org.apache.mina.common.IoFilter">
>              <ref bean="sslFilter" /> 
>              <ref bean="codecFilter" /> 
>         </list>
>     </constructor-arg>
> </bean>
> {quote}
> After that, the consumer endpoint URL can look like
> {{from("mina:tcp://")}}.
> I am not sure whether this approach is optimal, therefore I call it "workaround" and
not "solution".  The corresponding patch is attached.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message