You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Walzer, Thomas" <th...@integratix.net> on 2016/02/12 13:36:39 UTC
blueprint/nettyencoderfactory
Hi there,
I tried (on camel 2.15.2):
<bean id="hl7nettyencoder" class="org.apache.camel.component.hl7.HL7MLLPNettyEncoderFactory“>
<property name="charset" value="utf-8"/>
</bean>
and
<bean id="hl7nettyencoder" class="org.apache.camel.component.hl7.HL7MLLPNettyEncoderFactory" factory-method="setCharset">
<argument value="utf-8"/>
</bean>
Both do not work.
Any ideas/suggestions?
Cheers, Thomas.
Re: blueprint/nettyencoderfactory
Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
Thomas -
Sorry - I was thinking of the Mina2 codec - my apologizes for any confusion I may have caused.
The Netty encoder/decoder factories should have a charset property (from the HL7MLLPConfigAwareChannelHandlerFactory), but I looked at the source and it appears the Netty decoder may not be using that value - I’m looking in HL7MLLPNettyDecoder.java. It looks like the constructor is using Charset.defaultCharset() rather than config.getCharset.
Can you test the decoder separately from the encoder to verify what I think I’m seeing?
> On Feb 15, 2016, at 4:35 AM, Walzer, Thomas <th...@integratix.net> wrote:
>
> Quinn, thanks for looking into this:
>
> However, the encoding parameter only works with the textline codec. The docs say (and I say it too, because I tested it):
>
>>>> The encoding (a charset name) to use for the textline codec. If not provided, Camel will use the JVM default Charset.<<<
>
> I worked around this by not sending a string to netty4 but a byte-array.
>
> Cheers, Thomas.
>
>> Am 12.02.2016 um 17:13 schrieb Quinn Stevenson <qu...@pronoia-solutions.com>:
>>
>> The Netty4 encoder/decoder don’t have a “Charset” property - this is controlled by the “encoding” URI parameter.
>>
>>
>>
>>> On Feb 12, 2016, at 5:36 AM, Walzer, Thomas <th...@integratix.net> wrote:
>>>
>>> Hi there,
>>>
>>> I tried (on camel 2.15.2):
>>>
>>>
>>> <bean id="hl7nettyencoder" class="org.apache.camel.component.hl7.HL7MLLPNettyEncoderFactory“>
>>> <property name="charset" value="utf-8"/>
>>> </bean>
>>>
>>> and
>>>
>>> <bean id="hl7nettyencoder" class="org.apache.camel.component.hl7.HL7MLLPNettyEncoderFactory" factory-method="setCharset">
>>> <argument value="utf-8"/>
>>> </bean>
>>>
>>> Both do not work.
>>>
>>> Any ideas/suggestions?
>>>
>>> Cheers, Thomas.
>>
>
Re: blueprint/nettyencoderfactory
Posted by "Walzer, Thomas" <th...@integratix.net>.
Quinn, thanks for looking into this:
However, the encoding parameter only works with the textline codec. The docs say (and I say it too, because I tested it):
>>>The encoding (a charset name) to use for the textline codec. If not provided, Camel will use the JVM default Charset.<<<
I worked around this by not sending a string to netty4 but a byte-array.
Cheers, Thomas.
> Am 12.02.2016 um 17:13 schrieb Quinn Stevenson <qu...@pronoia-solutions.com>:
>
> The Netty4 encoder/decoder don’t have a “Charset” property - this is controlled by the “encoding” URI parameter.
>
>
>
>> On Feb 12, 2016, at 5:36 AM, Walzer, Thomas <th...@integratix.net> wrote:
>>
>> Hi there,
>>
>> I tried (on camel 2.15.2):
>>
>>
>> <bean id="hl7nettyencoder" class="org.apache.camel.component.hl7.HL7MLLPNettyEncoderFactory“>
>> <property name="charset" value="utf-8"/>
>> </bean>
>>
>> and
>>
>> <bean id="hl7nettyencoder" class="org.apache.camel.component.hl7.HL7MLLPNettyEncoderFactory" factory-method="setCharset">
>> <argument value="utf-8"/>
>> </bean>
>>
>> Both do not work.
>>
>> Any ideas/suggestions?
>>
>> Cheers, Thomas.
>
Re: blueprint/nettyencoderfactory
Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
The Netty4 encoder/decoder don’t have a “Charset” property - this is controlled by the “encoding” URI parameter.
> On Feb 12, 2016, at 5:36 AM, Walzer, Thomas <th...@integratix.net> wrote:
>
> Hi there,
>
> I tried (on camel 2.15.2):
>
>
> <bean id="hl7nettyencoder" class="org.apache.camel.component.hl7.HL7MLLPNettyEncoderFactory“>
> <property name="charset" value="utf-8"/>
> </bean>
>
> and
>
> <bean id="hl7nettyencoder" class="org.apache.camel.component.hl7.HL7MLLPNettyEncoderFactory" factory-method="setCharset">
> <argument value="utf-8"/>
> </bean>
>
> Both do not work.
>
> Any ideas/suggestions?
>
> Cheers, Thomas.