MMMicha
Hi.,
I ported the Java Messenger demo Data- and MetaDataAdapters to a .NET version. When I subscribe to the Adapters my buddylist is updated correctly on all subscribed sessions.
However, when I try to send a new message to one of the subscribed buddies the lightstreamer server console gives me a very weird error.
20.apr.10 12:12:48,986 < INFO> Sending message to session: S300999a1064e47b0T120
6726 from 127.0.0.1:63303
20.apr.10 12:12:48,987 <ERROR> Got exception for new message Messages[1] in session
S300999a1064e47b0T1206726: Session error: Unsupported function
Can you please provide me with some insights on how to resolve this error, or where to look for the solution.
Because right now I really don’t know where to look anymore. I even tried to add the Console.WriteLine on every method
In my MetaDataProvider, but after the web client calls engineref.sendMessage() the MetaDataAdapter .NET method “NotifyUserMessage()” never gets called.
Thanks in advance
Dario Crivelli
The "Unsupported function" message is the default no-op behavior for NotifyUserMessagethat is defined in the MetadataProviderAdapter class.
This class is supplied in LS library as a possible base class for a custom Metadata Adapter.
The sample LiteralBasedProvider also inherits from this class.
Is it possible that your Metadata Adapter class does not override NotifyUserMessage properly?
You can ensure that by removing any dependance from MetadataProviderAdapter.
MMMicha
Hi,
well i indead use the LiteralBasedProvider as my class inheritance. following is my ported from java implementation of the NotifyUserMessage method:
public override void NotifyUserMessage(String user, String session, String message)
{
Console.WriteLine("NotifyUserMessage");
try
{
if (message == null)
{
//logger.warn("Null message received");
throw new NotificationException("Null message received");
}
//Split the string on the | character
//The message must be of the form "SDNINBOXNOTIFICATIONSERVER|fromId|toId|message"
Char[] SplitChar = "|".ToCharArray();
String[] pieces = message.Split(SplitChar);
Console.WriteLine("New incoming data: " + "User: " + user + " session: " + session + " message: " + message);
SetupConnectionPipe();
HandleNewIncomingInboxData(pieces, message, user);
}
catch (Exception Error)
{
Console.WriteLine("what fsdfsdfs: " + Error);
}
}
But Console.WriteLine doesn't get called, hence nothing is called in this method. The only thing i see is dat the Constructor of my class wich inherits LiteralBasedProvider and also the overrided Init method gets called on execution. When i press the button with executes the sendMessage() method the console provided me with the Session error, error.
Grtz,
Micha
Dario Crivelli
I can't replicate the issue.
I wonder whether your use of Stringinstead of string in the method declaration may have any platform-dependent issue.
I still suggest you trying to remove the inheritance from MetadataProviderAdapter (hence, from LiteralBasedProvider),
so that any overriding issue is transferred at compilation level.
MMMicha
Hi,
i tried both of the methods. Replaced String with string in the method declaration but no success. I removed the inheritance from the LiteralBasedProvider but i got the same message on the lightstreamer server console. So it looks like he doesn't understand that he needs to call my MetaDataAdapter. Can it be an issue that i use a standalone server launcher, same as in the PortfolioDemo? The weird thing is, that on startup of both the consoles the constructor and the overrided Init method of the MetaDataAdapter i wrote gets called.
Should i post more code?
Dario Crivelli
The standalone Remote Server launcher, as provided in our examples, directly creates an instance of the Metadata Adapter,
so, if you properly extended it to use your class, it should not cause problems.
However, if there is a configuration issue, a different Metadata Adapter may be attached by the Server.
As a first step, please show us the Server log, after performing the following settings:
- set the com.lightstreamer.adapters.remote category to DEBUG level;
- ensure that the LightstreamerLogger.init category is at INFO level.
MMMicha
After making the requested settings to the log this is what i got in the console after trying to send a message to another online buddie:
21-apr-10 13:19:40,997 |INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 8 |Serving request: /lightstreamer/control.js --> LS_session=Sff17d61f15397ecaT1915608&LS_table=2&LS_win_phase=8&LS_op=add&LS_req_phase=341&LS_mode=DISTINCT&LS_id=im_Gast223&LS_schema=fromNick%20toNick%20message&LS_snapshot=30&LS_unique=3& from 127.0.0.1:55395
21-apr-10 13:19:40,998 |INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 8 |Controlling session: Sff17d61f15397ecaT1915608 from 127.0.0.1:55395
21-apr-10 13:19:41,000 |DEBUG|emote.request_reply.RequestSender|SERVER POOLED THREAD 8 |Sending request 30000012820171d81: 'SUB|S|im_Gast223'...
21-apr-10 13:19:41,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: '1271848781002|EOS|S|im_Gast223|S|30000012820171d81'...
21-apr-10 13:19:41,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: '1271848781002|UD3|S|buddy_list|S|20000012820171d81|B|0|S|key|S|im_Gast223|S|command|S|ADD'...
21-apr-10 13:19:41,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: '30000012820171d81|SUB|V'...
21-apr-10 13:19:41,013 |INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 5 |Serving request: /lightstreamer/control.js --> LS_session=Sff17d61f15397ecaT1915608&LS_table=3&LS_win_phase=8&LS_op=add&LS_req_phase=342&LS_mode=COMMAND&LS_id=buddy_list&LS_schema=command%20key&LS_snapshot=true&LS_unique=4& from 127.0.0.1:55401
21-apr-10 13:19:41,014 |INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 3 |Controlling session: Sff17d61f15397ecaT1915608 from 127.0.0.1:55401
21-apr-10 13:19:42,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:42,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:43,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:43,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:44,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:44,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:45,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:45,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:46,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:46,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:47,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:47,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:48,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:48,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:49,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:49,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:49,645 |INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 2 |Serving request: /lightstreamer/send_message.js --> LS_session=Sff17d61f15397ecaT1915608&LS_message=SDNINBOXPUSHER%7CGast143%7Cim_Gast223%7Choi&LS_req_phase=0&LS_sequence=messages&LS_max_wait=5000&LS_unique=5& from 127.0.0.1:55389
21-apr-10 13:19:49,646 |INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 2 |Sending message to session: Sff17d61f15397ecaT1915608 from 127.0.0.1:55389
21-apr-10 13:19:49,649 |ERROR|LightstreamerLogger.pump.messages|SERVER POOLED THREAD 2 |Got exception for new message messages[0] in session Sff17d61f15397ecaT1915608: Session error: Unsupported function
21-apr-10 13:19:50,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:50,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:51,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:51,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:52,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:52,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:53,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:53,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:54,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:54,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:55,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:55,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:56,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:56,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:57,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:57,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:58,004 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:58,004 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:59,004 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:59,004 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:20:00,004 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:20:00,004 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:20:00,736 |INFO |emote.request_reply.RequestSender|#1 Request Sender |Request sender '#1' stopped
21-apr-10 13:20:00,737 |INFO |mote.request_reply.NotifyReceiver|#1 Reply Receiver |Reply receiver '#1' stopped
Dario Crivelli
The message request is not forwarded to the Remote Server,
so it seems that the Server is not configured for the use of the Proxy Adapter for the Metadata part,
as it is in DOCS-SDKs\sdk_adapter_dotnet\examples\Remote_Portfolio_Adapters\Deployment\Deployment_LS\Portfolio_sockets\adapters.xml;
it is probably configured for the local java-based LiteralBasedProvider,
as in DOCS-SDKs\sdk_adapter_java\examples\StockListDemo_DataAdapter\Deployment_LS\StockList\adapters.xml.
The initial part of the Server log could offer more evidence.
MMMicha
Okay,
but i don't understand the difference 'cause in the Portfolio_sockter adapters.xml the metadataprovider is linked to <adapter_class>com.lightstreamer.adapters.remote.metadata.NetworkedMetadataProvider</adapter_class>. I used the same configuration only different port numbers.
Dario Crivelli
For some unclear reason, your configuration is not used.
If multiple Adapter Sets or multiple Remote Servers are configured, the wrong one may be used for your requests.
What does the Server log at startup?
What does it log when the session is created?
MMMicha
I've got it working now. The .net private messenger works exactly like the java version.
I implemented all of the methods found in LiteralBasedProvider. Apparently the server was searching for one of those methods, but couldn't find them so raised an exception.
thnx for the support.
Alessandro Alinone
That's good news :Smile_Ab: