You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Hemambara <ko...@gmail.com> on 2020/01/22 19:29:47 UTC

Custom IgniteConfiguration does not work

I am trying to extend IgniteConfiguration class and try to enhance its
properties as I needed them for some custom checks. I have created config
like below and started using Ignition.start(<config url>)

But when I call GridKernalContext.config() I am not getting
MyCustomIgniteConfiguration instance. I am still getting IgniteConfiguration
reference.

<bean id="ignite.cfg2" class="com.xyz.MyCustomIgniteConfiguration">
        <property name="clientMode" value="true" />
        <property name="igniteInstanceName" value="xyz" />

<property name="customProperty" value="customValue"/>
---
</bean>

This is happening because IgnitionEx has below code in
initializeConfiguration() method. So even if I extend this configuration it
is creating new instance and using that. 

Question is : Is there any reason why it is not honoring what client provide
in config xml ? Seems like a bug to me.

 private IgniteConfiguration initializeConfiguration(IgniteConfiguration
cfg) throws IgniteCheckedException {
            IgniteConfiguration myCfg = new IgniteConfiguration(cfg);



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Custom IgniteConfiguration does not work

Posted by Ivan Pavlukhin <vo...@gmail.com>.
A side note. A minor improvement for Igntie codebase could be making
IgniteConfiguration class final.

чт, 23 янв. 2020 г. в 15:01, Ilya Kasnacheev <il...@gmail.com>:
>
> Hello!
>
> I don't think you are supposed to inherit from IgniteConfiguration. Why would you want to?
>
> If you want to pass some data around, you can try using e.g. IgniteConfiguration.setUserAttributes.
>
> Regards,
> --
> Ilya Kasnacheev
>
>
> ср, 22 янв. 2020 г. в 22:30, Hemambara <ko...@gmail.com>:
>>
>> I am trying to extend IgniteConfiguration class and try to enhance its
>> properties as I needed them for some custom checks. I have created config
>> like below and started using Ignition.start(<config url>)
>>
>> But when I call GridKernalContext.config() I am not getting
>> MyCustomIgniteConfiguration instance. I am still getting IgniteConfiguration
>> reference.
>>
>> <bean id="ignite.cfg2" class="com.xyz.MyCustomIgniteConfiguration">
>>         <property name="clientMode" value="true" />
>>         <property name="igniteInstanceName" value="xyz" />
>>
>> <property name="customProperty" value="customValue"/>
>> ---
>> </bean>
>>
>> This is happening because IgnitionEx has below code in
>> initializeConfiguration() method. So even if I extend this configuration it
>> is creating new instance and using that.
>>
>> Question is : Is there any reason why it is not honoring what client provide
>> in config xml ? Seems like a bug to me.
>>
>>  private IgniteConfiguration initializeConfiguration(IgniteConfiguration
>> cfg) throws IgniteCheckedException {
>>             IgniteConfiguration myCfg = new IgniteConfiguration(cfg);
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/



-- 
Best regards,
Ivan Pavlukhin

Re: Custom IgniteConfiguration does not work

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

I don't think you are supposed to inherit from IgniteConfiguration. Why
would you want to?

If you want to pass some data around, you can try using e.g.
IgniteConfiguration.setUserAttributes.

Regards,
-- 
Ilya Kasnacheev


ср, 22 янв. 2020 г. в 22:30, Hemambara <ko...@gmail.com>:

> I am trying to extend IgniteConfiguration class and try to enhance its
> properties as I needed them for some custom checks. I have created config
> like below and started using Ignition.start(<config url>)
>
> But when I call GridKernalContext.config() I am not getting
> MyCustomIgniteConfiguration instance. I am still getting
> IgniteConfiguration
> reference.
>
> <bean id="ignite.cfg2" class="com.xyz.MyCustomIgniteConfiguration">
>         <property name="clientMode" value="true" />
>         <property name="igniteInstanceName" value="xyz" />
>
> <property name="customProperty" value="customValue"/>
> ---
> </bean>
>
> This is happening because IgnitionEx has below code in
> initializeConfiguration() method. So even if I extend this configuration it
> is creating new instance and using that.
>
> Question is : Is there any reason why it is not honoring what client
> provide
> in config xml ? Seems like a bug to me.
>
>  private IgniteConfiguration initializeConfiguration(IgniteConfiguration
> cfg) throws IgniteCheckedException {
>             IgniteConfiguration myCfg = new IgniteConfiguration(cfg);
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>