Foren

Liferay Integration with Jms; Event based

Crina Arsenie, geändert vor 10 Jahren.

Liferay Integration with Jms; Event based

New Member Beiträge: 9 Beitrittsdatum: 15.03.13 Neueste Beiträge
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
thumbnail
Juan Gonzalez, geändert vor 10 Jahren.

RE: Liferay Integration with Jms; Event based

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
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, geändert vor 10 Jahren.

RE: Liferay Integration with Jms; Event based

New Member Beiträge: 9 Beitrittsdatum: 15.03.13 Neueste Beiträge
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
thumbnail
Juan Gonzalez, geändert vor 10 Jahren.

RE: Liferay Integration with Jms; Event based

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
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.
thumbnail
David H Nebinger, geändert vor 10 Jahren.

RE: Liferay Integration with Jms; Event based

Liferay Legend Beiträge: 14914 Beitrittsdatum: 02.09.06 Neueste Beiträge
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, geändert vor 10 Jahren.

RE: Liferay Integration with Jms; Event based

New Member Beiträge: 9 Beitrittsdatum: 15.03.13 Neueste Beiträge
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, geändert vor 10 Jahren.

RE: Liferay Integration with Jms; Event based

New Member Beiträge: 9 Beitrittsdatum: 15.03.13 Neueste Beiträge
David, can you give an example please? I saw that the Audit portlet uses the Message Bus.
Thank you
Crina Arsenie, geändert vor 10 Jahren.

RE: Liferay Integration with Jms; Event based

New Member Beiträge: 9 Beitrittsdatum: 15.03.13 Neueste Beiträge
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
Crina Arsenie, geändert vor 10 Jahren.

RE: Liferay Integration with Jms; Event based

New Member Beiträge: 9 Beitrittsdatum: 15.03.13 Neueste Beiträge
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
thumbnail
Juan Gonzalez, geändert vor 10 Jahren.

RE: Liferay Integration with Jms; Event based

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Hi Crina,

Nope, they wouldn't be an option in that case.