Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Crina Arsenie
Liferay Integration with Jms; Event based
23. April 2013 06:25
Antwort

Crina Arsenie

Rang: New Member

Nachrichten: 9

Eintrittsdatum: 15. März 2013

Neue 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
Juan Gonzalez
RE: Liferay Integration with Jms; Event based
23. April 2013 06:59
Antwort

Juan Gonzalez

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 1872

Eintrittsdatum: 28. Oktober 2008

Neue 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
RE: Liferay Integration with Jms; Event based
23. April 2013 08:01
Antwort

Crina Arsenie

Rang: New Member

Nachrichten: 9

Eintrittsdatum: 15. März 2013

Neue 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
Juan Gonzalez
RE: Liferay Integration with Jms; Event based
23. April 2013 11:30
Antwort

Juan Gonzalez

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 1872

Eintrittsdatum: 28. Oktober 2008

Neue 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.
David H Nebinger
RE: Liferay Integration with Jms; Event based
23. April 2013 12:16
Antwort

David H Nebinger

Rang: Liferay Legend

Nachrichten: 6706

Eintrittsdatum: 1. September 2006

Neue 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
RE: Liferay Integration with Jms; Event based
24. April 2013 01:23
Antwort

Crina Arsenie

Rang: New Member

Nachrichten: 9

Eintrittsdatum: 15. März 2013

Neue 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
RE: Liferay Integration with Jms; Event based
24. April 2013 01:21
Antwort

Crina Arsenie

Rang: New Member

Nachrichten: 9

Eintrittsdatum: 15. März 2013

Neue 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
Juan Gonzalez
RE: Liferay Integration with Jms; Event based
24. April 2013 01:22
Antwort

Juan Gonzalez

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 1872

Eintrittsdatum: 28. Oktober 2008

Neue Beiträge

Hi Crina,

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

Crina Arsenie

Rang: New Member

Nachrichten: 9

Eintrittsdatum: 15. März 2013

Neue Beiträge

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
28. April 2013 13:25
Antwort

Crina Arsenie

Rang: New Member

Nachrichten: 9

Eintrittsdatum: 15. März 2013

Neue 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