Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Arko Mahmud
Camel Endpoints And Data Representation
July 25, 2013 4:37 AM
Answer

Arko Mahmud

Rank: Junior Member

Posts: 43

Join Date: June 11, 2013

Recent Posts

Hi
I have a Camel Endpoint from where I get messages, I want to represent data in real time graph. And update Database also using Liferay portlet.
I am new in this area. Could anyone suggest some Liferay way to do it ?

Like Libraries and Technologies I should read about i.......

Thanks In advance...
David H Nebinger
RE: Camel Endpoints And Data Representation
July 25, 2013 5:55 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7227

Join Date: September 1, 2006

Recent Posts

I have a similar thing. Camel consumer will invoke SB custom methods to persist data.

The graphing thing will be challenging. You may have 5 users showing the graph, but there will be only a single camel consumer. Depending upon what the graph would contain, you could do the following:

1. custom SB method updates a 'fake entity' to store updated info from each message; graphing is then based on getting the latest info from SB to use in the graph, then you just need to deal w/ the refresh, but it's not real time.

2. 5 portlets create separate destinations in the Liferay Message Bus and register the destination w/ SB code. When SB is processing the save, it pushes a message to each registered destination, 5 portlets get individual messages to use for the display.
Arko Mahmud
RE: Camel Endpoints And Data Representation
July 25, 2013 6:32 AM
Answer

Arko Mahmud

Rank: Junior Member

Posts: 43

Join Date: June 11, 2013

Recent Posts

Hello
Thanks for your reply!
Could you recommend any sample portlet for that ? or similar work ?
I didn't get the Idea of creating 5 portlets. I am sorry But I am new with this technology.

Can I use DWR or comet to publish data ?

Idea is I have a endpoint like this

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<newdata xmlns="..../datameter" xmlns:s12="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wse="http://schemas.xmlsoap.org/ws/2004/08/eventing" DeviceId="Datasource1" Timestamp="2000-01-02T00:17:47.630">
<Profile>1</Profile>
<source ID="Source1">
<data1>4.65</data1>
<data2>0.03</data2>
<data3>0.00</data3>
</source>
<source ID="Source2">
<data1>4.00</data1>
<data2>0.05</data2>
<data3>0.01</data3>
</source>
</newdata>

I want to get the data and represent in real time (or online) may be using highcharts.

Could I get any step by step instruction ?
David H Nebinger
RE: Camel Endpoints And Data Representation
July 25, 2013 8:54 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7227

Join Date: September 1, 2006

Recent Posts

No examples or anything, you're off in custom development land...

Portlets are placed on a page, but you have to remember that many users could be looking at the page so you'll have that many instances. No single portlet instance should consume from JMS as that would not allow other instances to see the message and therefore you only get a partial view.

However, using the LMB each instance can register a destination and you can broadcast the one JMS message to all registered destinations. Each portlet instance would receive a copy of the message and can do what it needs to.

So this is all on the server side; to get it to update in the browser you'll need some sort of push technology, any that you're familiar with should work.
Arko Mahmud
RE: Camel Endpoints And Data Representation
September 25, 2013 3:16 AM
Answer

Arko Mahmud

Rank: Junior Member

Posts: 43

Join Date: June 11, 2013

Recent Posts

hello David
At last I managed to make, Camel endpoint and also started receiving message there. Everything works fine. But the problem is when I try to stop the server, I get following warnings, and server doesn't stop... Just pause at the last line. Do you have any idea why it is happening ?
Thanks for your answer in advance !

 1SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [CamelJettyClient(0x1bf031b)-80] but has failed to stop it. This is very likely to create a memory leak.
 225.9.2013 10:11:33 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
 3SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [CamelJettyClient(0x1bf031b)-81] but has failed to stop it. This is very likely to create a memory leak.
 425.9.2013 10:11:33 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
 5SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [CamelJettyClient(0x1bf031b)-82] but has failed to stop it. This is very likely to create a memory leak.
 625.9.2013 10:11:33 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
 7SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [CamelJettyClient(0x1bf031b)-83] but has failed to stop it. This is very likely to create a memory leak.
 825.9.2013 10:11:33 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
 9SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [CamelJettyClient(0x1bf031b)-84] but has failed to stop it. This is very likely to create a memory leak.
1025.9.2013 10:11:33 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
11SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [CamelJettyClient(0x1bf031b)-85] but has failed to stop it. This is very likely to create a memory leak.
1225.9.2013 10:11:33 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
13SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [CamelJettyClient(0x1bf031b)-86] but has failed to stop it. This is very likely to create a memory leak.
1425.9.2013 10:11:33 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
15SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [CamelJettyClient(0x1bf031b)-87] but has failed to stop it. This is very likely to create a memory leak.
1625.9.2013 10:11:33 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
17SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [qtp28952668-88 Selector0] but has failed to stop it. This is very likely to create a memory leak.
1825.9.2013 10:11:33 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
19SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [qtp28952668-89 Acceptor0 SelectChannelConnector@192.168.1.168:1989] but has failed to stop it. This is very likely to create a memory leak.
2025.9.2013 10:11:33 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
21SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [qtp28952668-90] but has failed to stop it. This is very likely to create a memory leak.
2225.9.2013 10:11:33 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
23SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [qtp28952668-91] but has failed to stop it. This is very likely to create a memory leak.
2425.9.2013 10:11:33 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
25SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [qtp28952668-92] but has failed to stop it. This is very likely to create a memory leak.
2625.9.2013 10:11:33 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
27SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [qtp28952668-93] but has failed to stop it. This is very likely to create a memory leak.
2825.9.2013 10:11:33 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
29SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [qtp28952668-94] but has failed to stop it. This is very likely to create a memory leak.
3025.9.2013 10:11:33 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
31SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [qtp28952668-95] but has failed to stop it. This is very likely to create a memory leak.
3225.9.2013 10:11:33 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
33SEVERE: The web application [/StreamLive-portlet] appears to have started a thread named [Camel (camel-1) thread #0 - ManagementLoadTask] but has failed to stop it. This is very likely to create a memory leak.
3425.9.2013 10:11:34 org.apache.coyote.AbstractProtocol stop
35INFO: Stopping ProtocolHandler ["http-bio-8080"]
3625.9.2013 10:11:34 org.apache.coyote.AbstractProtocol stop
37INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
3825.9.2013 10:11:34 org.apache.coyote.AbstractProtocol destroy
39INFO: Destroying ProtocolHandler ["http-bio-8080"]
4025.9.2013 10:11:34 org.apache.coyote.AbstractProtocol destroy
41INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
David H Nebinger
RE: Camel Endpoints And Data Representation
September 25, 2013 8:04 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7227

Join Date: September 1, 2006

Recent Posts

Yep, you'll need to trap the destroy method of your portlet to shut down camel cleanly.
Arko Mahmud
RE: Camel Endpoints And Data Representation
September 30, 2013 7:49 AM
Answer

Arko Mahmud

Rank: Junior Member

Posts: 43

Join Date: June 11, 2013

Recent Posts

Thanks for your all your support emoticon
It works Now emoticon
I feel, I am becoming a Liferay Developer emoticon