Hello Guiseppe,
Thank you once again for your time and assistance.
I have modified my code to include your sample code as follows:
... public class RoundTripDataAdapter implements SmartDataProvider {
private static final String ROUNDTRIP_PREFIX = "roundtrip"; ...
and further down:
... // Adapter ready
logger.info("RounTripDataAdapter
V28 ready");
}
public void subscribe(String item, Object handle, boolean arg2)
throws SubscriptionException, FailureException {
assert(! subscriptions.containsKey(item));
if (!item.
startsWith(ROUNDTRIP_PREFIX) ) {
//valid items are in the range rountrip0 - roundtrip999
throw new SubscriptionException("No such item");
} ...
Unfortunately, the result is the same as before.
Any item numbered higher than 'roundtrip99', e.g. 'roundtrip100', stillreturns the following error:
... 19.Apr.16 14:17:55,098 < INFO> roundtrip1 subscribed
19.Apr.16 14:17:55,098 < INFO> roundtrip99 subscribed
19.Apr.16 14:21:23,811 < WARN> Received message for wrong or not-subscribed channel
19.Apr.16 14:21:23,811 < WARN> Wrong message received: RT|100| 100 ...
The log also indicates that the Server is referencing the correct adaptor file by returning the following:
... 19.Apr.16 14:17:54,552 < INFO> RounTripDataAdapter V28 ready ...
The following is an extract from the decompiled jar, indicating that the prefix string is passing to the argument:
... this.logger.info((Object)"RounTripDataAdapter V28 ready");
}
public void subscribe(String item, Object handle, boolean arg2) throws SubscriptionException, FailureException {
assert (!this.subscriptions.containsKey(item));
if (!item.startsWith("roundtrip")) {
throw new SubscriptionException("No such item");
}
this.subscriptions.put(item, handle);
this.sendSnapshot(item);
this.logger.info((Object)(item + " subscribed"));
}
I hope sufficient information has been provided to further investigate this problem.
Many thanks and best regards,
longtrain0
Giuseppe Corti Hi longtrain0,
Once defined at the beginning of RoundTripDataAdapter class
[SYNTAX=JAVA]private static final String ROUNDTRIP_PREFIX = "roundtrip";[/SYNTAX]
you should replace
[SYNTAX=JAVA]if (!item.matches("^roundtrip[01234]$")) {[/SYNTAX]
with something like this
[SYNTAX=JAVA]if (!item.startsWith(ROUNDTRIP_PREFIX) ) {[/SYNTAX]
About the identification in the init method, I meant to add a specific identifier to the "ready" log in order to detect which version is running. Ie.
[SYNTAX=JAVA]logger.info ("RounTripDataAdapter v28 ready");[/SYNTAX]
Regards,
Giuseppe