question

Upvotes
Accepted
43 3 4 5

EZD username configuration in EMA (Java) when using Channel Sets

By creating an EmaConfig.xml file and setting multiple channels (one per server) it will automatically connect to the second channel if the first channel fails.

However I can't work out how to set the ezd username in the code.

Normally (no EmaConfig.xml file) I would do the following...

OmmConsumerConfig config = EmaFactory.createOmmConsumerConfig();

consumer = EmaFactory.createOmmConsumer(config.host("ezd-a:14002").username(ezdUsername));

However when an EmaConfig.xml file is used I am supposed to specify the Consumer name from the EmaConfig.xml file as per below.... But I can't find where to specify the ezd username in this approach. Specifying a config.host(....) will override the multi channel config, and trying to set the username directly against the config (as per below) does not work either...

OmmConsumerConfig
config = EmaFactory.createOmmConsumerConfig().consumerName("Consumer_2");consumer 
= EmaFactory.createOmmConsumer(config.username(ezdUsername));
elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apiauthentication
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
Accepted
9.5k 10 5 7

Hello @Tokyo Nick,

OmmConsumerConfig.consumerName(String) returns OmmConsumerConfig so you can call OmmConsumerConfig.username(String) in the same line as shown below:

consumer  = EmaFactory.createOmmConsumer(EmaFactory.createOmmConsumerConfig().consumerName("Consumer_2").username(ezdUsername));

Please try this.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
43 3 4 5

Thanks @Pimchaya.Wongrukun ! Just to confirm, the code you described above will not interfere with any multi channel configuration coded in the EmaConfig.xml file, is my understanding correct? Much appreciated!

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
9.5k 10 5 7

Hello @Tokyo Nick.

The code above is to use configuration in "Consumer_2" node with username is ezdUsername. It should not interfere multi channel configuration specified in "Consumer_2" node.

Another possible way is to set default consumer to be "Consumer_2"(Default is Consumer_1" in EmaConfig.xml file:

<DefaultConsumer value="Consumer_2"/>

Then, the source code does not need to specify the consumer node, just specify the user name as shown below:

consumer  = EmaFactory.createOmmConsumer(EmaFactory.createOmmConsumerConfig().username(ezdUsername));
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
43 3 4 5

@Pimchaya.Wongrukun Thanks again! I will have this method tested and confirmed with our customer. Much appreciated!

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
43 3 4 5

Hi @Pimchaya.Wongrukun , thanks again for your support. We confirmed that the code your proposed worked. Much appreciated!

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.