Here is the client code that is executed from either Server1 or Server2:
| private void triggerSecurityReloadForLoginIds(HashSet loginIds)
| {
| if (loginIds.size() > 0)
| {
| TopicConnection topicConnection = null;
| try
| {
| ServiceLocator sl =
ServiceLocator.getInstance();
|
| Context ctx = new InitialContext();
| TopicConnectionFactory cf =
(TopicConnectionFactory) ctx
| .lookup("/ConnectionFactory");
|
| topicConnection = cf.createTopicConnection();
| TopicSession topicSession =
topicConnection.createTopicSession(
| false,
Session.AUTO_ACKNOWLEDGE);
|
| String remoteQueueHost = Env.getInstance()
| .getJMSRemoteQueueHost();
| ctx = sl.getInitialContext(remoteQueueHost);
| String localTopicName = Env.getInstance()
|
.getReloadSecurityCacheTopicJndi();
| Topic topic = (Topic)
ctx.lookup(localTopicName);
|
| ObjectMessage objectMessage = topicSession
| .createObjectMessage();
| TopicPublisher topicPublisher = topicSession
| .createPublisher(topic);
| objectMessage.setObject(loginIds);
| topicPublisher.publish(objectMessage);
| log
|
.info("triggerSecurityReloadForLoginIds sent reload message <"
| +
objectMessage.getJMSMessageID()
| + "> - for
logonIds: " + loginIds);
| } catch (Exception e)
| {
| // just log the Exception
| String msg = e.getMessage();
| log.fatal(msg);
| } finally
| {
| if (topicConnection != null)
| {
| try
| {
| topicConnection.close();
| } catch (Exception e)
| {
| }
| }
| }
| }
|
| }
|
The value of "remoteQueueHost" is different when executed from Server1 or
Server2. The property is tokenized through our build process. For Server1
"remoteQueueHost" = localhost. For Server2 "remoteQueueHost" = Server1.
This code executes without errors from either Server1 or Server2 but the
message is only propogated successfully from Server1.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163119#4163119
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163119
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user