掲示板

Liferay Integration with Jms; Event based

10年前 に Crina Arsenie によって更新されました。

Liferay Integration with Jms; Event based

New Member 投稿: 9 参加年月日: 13/03/15 最新の投稿
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
10年前 に Juan Gonzalez によって更新されました。

RE: Liferay Integration with Jms; Event based

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
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
10年前 に Crina Arsenie によって更新されました。

RE: Liferay Integration with Jms; Event based

New Member 投稿: 9 参加年月日: 13/03/15 最新の投稿
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
10年前 に Juan Gonzalez によって更新されました。

RE: Liferay Integration with Jms; Event based

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
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
10年前 に David H Nebinger によって更新されました。

RE: Liferay Integration with Jms; Event based

Liferay Legend 投稿: 14915 参加年月日: 06/09/02 最新の投稿
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...
10年前 に Crina Arsenie によって更新されました。

RE: Liferay Integration with Jms; Event based

New Member 投稿: 9 参加年月日: 13/03/15 最新の投稿
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.
10年前 に Crina Arsenie によって更新されました。

RE: Liferay Integration with Jms; Event based

New Member 投稿: 9 参加年月日: 13/03/15 最新の投稿
David, can you give an example please? I saw that the Audit portlet uses the Message Bus.
Thank you
10年前 に Crina Arsenie によって更新されました。

RE: Liferay Integration with Jms; Event based

New Member 投稿: 9 参加年月日: 13/03/15 最新の投稿
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
10年前 に Crina Arsenie によって更新されました。

RE: Liferay Integration with Jms; Event based

New Member 投稿: 9 参加年月日: 13/03/15 最新の投稿
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
10年前 に Juan Gonzalez によって更新されました。

RE: Liferay Integration with Jms; Event based

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Hi Crina,

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