フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Crina Arsenie
Liferay Integration with Jms; Event based
2013/04/23 6:25
答え

Crina Arsenie

ランク: New Member

投稿: 9

参加年月日: 2013/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
Juan Gonzalez
RE: Liferay Integration with Jms; Event based
2013/04/23 6:59
答え

Juan Gonzalez

LIFERAY STAFF

ランク: Liferay Legend

投稿: 2892

参加年月日: 2008/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
Crina Arsenie
RE: Liferay Integration with Jms; Event based
2013/04/23 8:01
答え

Crina Arsenie

ランク: New Member

投稿: 9

参加年月日: 2013/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
Juan Gonzalez
RE: Liferay Integration with Jms; Event based
2013/04/23 11:30
答え

Juan Gonzalez

LIFERAY STAFF

ランク: Liferay Legend

投稿: 2892

参加年月日: 2008/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.
David H Nebinger
RE: Liferay Integration with Jms; Event based
2013/04/23 12:16
答え

David H Nebinger

Community Moderator

ランク: Liferay Legend

投稿: 11492

参加年月日: 2006/09/01

最近の投稿

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
2013/04/24 1:23
答え

Crina Arsenie

ランク: New Member

投稿: 9

参加年月日: 2013/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.
Crina Arsenie
RE: Liferay Integration with Jms; Event based
2013/04/24 1:21
答え

Crina Arsenie

ランク: New Member

投稿: 9

参加年月日: 2013/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
Juan Gonzalez
RE: Liferay Integration with Jms; Event based
2013/04/24 1:22
答え

Juan Gonzalez

LIFERAY STAFF

ランク: Liferay Legend

投稿: 2892

参加年月日: 2008/10/28

最近の投稿

Hi Crina,

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

Crina Arsenie

ランク: New Member

投稿: 9

参加年月日: 2013/03/15

最近の投稿

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
2013/04/28 13:25
答え

Crina Arsenie

ランク: New Member

投稿: 9

参加年月日: 2013/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