Java EMA: Problem subscribing to realtime and delayed ticker at same time

I'm able to subscribe to delayed names like /IBM.N and /SPY.P, but if I try to subscript to SPY.P, I cannot subsequently subscribe to /SPY.P when the user I'm subscribing with isn't permissioned for real-time.

What I'm seeing is that I try to subscribe to "SPY.P", and I get back a NotAuthorized status in onStatusMsg. When I receive that, I call OmmConsumer.unregister(handle) to unregister the SPY.P subscription, and then attempt to subscribe to "/SPY.P".

However, the consumer thinks I'm just trying to subscribe to SPY.P - I get a second NotAuthorized error and msg.getName() is "SPY.P", whereas it should be "/SPY.P". How can I successfully do this, or do I just have to do something like open up a second consumer for delayed subscriptions?

(I did try creating a second OmmConsumer just for delayed subscriptions, as a workaround, but then the delayed subscription on the second consumer results in a "Received an item event without user specified pointer or stream info" ItemCallbackException.

Looking for any advice on how to handle this.

Thanks,

Shawn

Answers

  • @shawn11

    From my test, this problem has been solved in Elektron SDK - Java - 1.1.1.E2. You can download it from here.

    Please try it and let us know the result.

  • @jirapongse.phuriphanvichai I'm still getting the same error in 1.1.1.E2

  • @shawn11

    My code may be too simple. Please see the attached file. consumerjava.txt

    If I use EMA Java 1.1.1.E2, the output is:

    StatusMsg
    streamId="5"
    domain="MarketPrice Domain"
    state="Closed / Suspect / Not entitled / 'Access Denied: User req to IDN for Exch - NYS'"
    name="IBM.N"
    nameType="1"
    serviceId="2115"
    serviceName="API_ELEKTRON_EPD_RSSL"
    StatusMsgEnd
    RefreshMsg
    streamId="6"
    domain="MarketPrice Domain"
    solicited
    RefreshComplete
    state="Open / Ok / None / 'All is well'"
    itemGroup="00 01"
    permissionData="03 08 43 40 17 c0"
    name="/IBM.N"
    nameType="1"
    serviceId="2115"
    serviceName="API_ELEKTRON_EPD_RSSL"
    Payload dataType="FieldList"

    From the output, it can subscribe to /IBM.N when IBM.N is access denied.

    However, if I use the same code with EMA Java 1.1.1.L1, I get this output.

    StatusMsg
    streamId="5"
    domain="MarketPrice Domain"
    state="Closed / Suspect / Not entitled / 'Access Denied: User req to IDN for Exch - NYS'"
    name="IBM.N"
    nameType="1"
    serviceId="2115"
    serviceName="API_ELEKTRON_EPD_RSSL"
    StatusMsgEnd


    StatusMsg
    streamId="6"
    domain="MarketPrice Domain"
    state="Closed / Suspect / Not entitled / 'Access Denied: User req to IDN for Exch - NYS'"
    name="IBM.N"
    nameType="1"
    serviceId="2115"
    serviceName="API_ELEKTRON_EPD_RSSL"
    StatusMsgEnd

    The subscribed item will always be IBM.N.

    Could you please share your code?

  • Hello @shawn11

    Could you please share us you source code as requested by Jirapongse?

  • @shawn11

    Please kindly update the progress of this issue.

    If you still see the problem, please share the code. Therefore, we can use it to replicate the issue.

  • Hello @shawn11

    If the problem still occurs, please send us your source code as requested by Jirapongse. This will allow us to help you to investigate the problem.