Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Crina Arsenie
Liferay Integration with Jms; Event based
April 23, 2013 6:25 AM
Answer

Crina Arsenie

Rank: New Member

Posts: 9

Join Date: March 15, 2013

Recent Posts

Hello,

I am trying to integrate Liferay with other standalone applications I have. I am therefor trying to insert messages into Liferay through an JMS broker (ActiveMQ). The idea is that one portlet could act as a mediator in the following way: he is implementing the MessageListener and listening on the Jms (topic) and a soon as a message comes into the topic, it receives it and dispatch it to all the other portlets. Then each portlet will react corresponding to its processEvent implementation.
My problem is that I realized this only if my dispatcher portlet has the "dispatching" action activated by an user interaction (through a button for which I set an actionListener). I want this to be done automatically. I tryed with a checkbox and a boolean which changes the value of the checkbox, so I added a valueChangeListener but It gives me the following error:

java.lang.ClassCastException: com.liferay.portlet.ResourceResponseImpl cannot be cast to javax.portlet.ActionResponse

If I am using RessouceResponse I cannot use the .sendEvent method which can be made with ActionResponse.
I am using jsf for the portlet development.

Can you give me some hints/ other options to make this connection ??
Many many thanks!
Crina
Juan Gonzalez
RE: Liferay Integration with Jms; Event based
April 23, 2013 6:59 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2350

Join Date: October 28, 2008

Recent Posts

Hi Crina,

If all of your portlets are inside the same Liferay installation, why don't you use MessageBus instead of JMS?

EDIT: here's a link with a good tutorial:

http://www.liferay.com/es/documentation/liferay-portal/6.1/development/-/ai/lp-6-1-dgen09-using-message-bus-0
Crina Arsenie
RE: Liferay Integration with Jms; Event based
April 23, 2013 8:01 AM
Answer

Crina Arsenie

Rank: New Member

Posts: 9

Join Date: March 15, 2013

Recent Posts

Hello Juan,

Thank you for the reply. All the portlets are inside Liferay but they are communicating with external applications, and I was thinking to do this connection (transfer of data between liferay portlets and other wars deployed in the same jboss7.1(my liferay container)) through jms. I thought the Message Bus is only another way of inter-portlet communication, am I wrong? Me, I am trying to communicate with the exterior. In that case, are you sugesting it to use it instead of event-based inter-portletcommunication ?

Thank you
Crina
Juan Gonzalez
RE: Liferay Integration with Jms; Event based
April 23, 2013 11:30 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2350

Join Date: October 28, 2008

Recent Posts

MessageBus could fit your needs if communication is made between portlets within Liferay. It can be asynchronous, so are the same as JMS, but without all that JMS configuration.

In case you want to send messages to other Java EE components outside Liferay, yep, you'll need JMS.
David H Nebinger
RE: Liferay Integration with Jms; Event based
April 23, 2013 12:16 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 9293

Join Date: September 1, 2006

Recent Posts

Actually, Crina, we use a combined approach... We have a JMS listener which receives the message and publishes to LMB. No issues receiving the messages then...
Crina Arsenie
RE: Liferay Integration with Jms; Event based
April 24, 2013 1:23 AM
Answer

Crina Arsenie

Rank: New Member

Posts: 9

Join Date: March 15, 2013

Recent Posts

Yes David,

I am receiving it also with a listener and sending the event if an user clicks a button, but my problem is that I want to send the event without any user interaction. Are you sending on the LMB without any user interaction?
Thank you for your answer.
Crina Arsenie
RE: Liferay Integration with Jms; Event based
April 24, 2013 1:21 AM
Answer

Crina Arsenie

Rank: New Member

Posts: 9

Join Date: March 15, 2013

Recent Posts

Yes Juan,

I want my portlets to communicate with outside standalone web apps, so that is why jms was an option. In case I deploy my other Java EE componenets, which are regular Java web apps, not portlets, is MessageBus still an option for communication?
Thank you
Juan Gonzalez
RE: Liferay Integration with Jms; Event based
April 24, 2013 1:22 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2350

Join Date: October 28, 2008

Recent Posts

Hi Crina,

Nope, they wouldn't be an option in that case.
Crina Arsenie
RE: Liferay Integration with Jms; Event based
April 28, 2013 9:58 AM
Answer

Crina Arsenie

Rank: New Member

Posts: 9

Join Date: March 15, 2013

Recent Posts

David, can you give an example please? I saw that the Audit portlet uses the Message Bus.
Thank you
Crina Arsenie
RE: Liferay Integration with Jms; Event based
April 28, 2013 1:25 PM
Answer

Crina Arsenie

Rank: New Member

Posts: 9

Join Date: March 15, 2013

Recent Posts

Hy again,

After searching the forum, i found one of your posts which is interesting for my situation also, i'll put a link (for people searching) here also
http://www.liferay.com/fr/community/forums/-/message_boards/message/21036964