/** * This method is provided for a clustered messaging with the routing-mode set to point-to-point. * On startup, a server invokes this method for each server to request its local subscription state. * * */ public void requestSubscriptions(String destinationId, Object remoteAddress) { ClusterManager clm = getMessageBroker().getClusterManager(); clm.invokePeerToPeerOperation(getClass().getName(), destinationId, ClusterManager.OPERATION_SEND_SUBSCRIPTIONS, new Object[] { destinationId }, remoteAddress); }
/** * This method is provided for a clustered messaging with the routing-mode set to point-to-point. * On startup, a server invokes this method for each server to request its local subscription state. * * @exclude */ public void requestSubscriptions(String destinationId, Object remoteAddress) { ClusterManager clm = getMessageBroker().getClusterManager(); clm.invokePeerToPeerOperation(getClass().getName(), destinationId, "sendSubscriptions", new Object[] { destinationId }, remoteAddress); }
/** * This method is provided for a clustered messaging with the routing-mode set to point-to-point. * On startup, a server invokes this method for each server to request its local subscription state. * * */ public void requestSubscriptions(String destinationId, Object remoteAddress) { ClusterManager clm = getMessageBroker().getClusterManager(); clm.invokePeerToPeerOperation(getClass().getName(), destinationId, ClusterManager.OPERATION_SEND_SUBSCRIPTIONS, new Object[] { destinationId }, remoteAddress); }
/** * * Called when we need to push a local subscribe/unsubscribe to all of the remote * servers. */ public void sendSubscribeFromPeer(String destinationId, Boolean subscribe, String selector, String subtopic) { ClusterManager clm = getMessageBroker().getClusterManager(); String serviceType = getClass().getName(); clm.invokeServiceOperation(serviceType, destinationId, ClusterManager.OPERATION_SUBSCRIBE_FROM_PEER, new Object[] { destinationId, subscribe, selector, subtopic, clm.getLocalAddress(serviceType, destinationId)}); }
/** * * Called when we need to push a local subscribe/unsubscribe to all of the remote * servers. */ public void sendSubscribeFromPeer(String destinationId, Boolean subscribe, String selector, String subtopic) { ClusterManager clm = getMessageBroker().getClusterManager(); String serviceType = getClass().getName(); clm.invokeServiceOperation(serviceType, destinationId, ClusterManager.OPERATION_SUBSCRIBE_FROM_PEER, new Object[] { destinationId, subscribe, selector, subtopic, clm.getLocalAddress(serviceType, destinationId)}); }
/** * Called when we need to push a local subscribe/unsubscribe to all of the remote * servers. * * @exclude */ public void sendSubscribeFromPeer(String destinationId, Boolean subscribe, String selector, String subtopic) { ClusterManager clm = getMessageBroker().getClusterManager(); String serviceType = getClass().getName(); clm.invokeServiceOperation(serviceType, destinationId, "subscribeFromPeer", new Object[] { destinationId, subscribe, selector, subtopic, clm.getLocalAddress(serviceType, destinationId)}); }
/** * Issue messages to request the remote subscription table from each server in the cluster (except this one). */ public void initRemoteSubscriptions(String destinationId) { ClusterManager clm = getMessageBroker().getClusterManager(); String serviceType = getClass().getName(); MessageDestination dest = (MessageDestination) getDestination(destinationId); Cluster cluster = clm.getCluster(serviceType, destinationId); if (cluster != null) cluster.addRemoveNodeListener(dest.getRemoteSubscriptionManager()); List members = clm.getClusterMemberAddresses(serviceType, destinationId); for (int i = 0; i < members.size(); i++) { Object addr = members.get(i); if (!clm.getLocalAddress(serviceType, destinationId).equals(addr)) requestSubscriptions(destinationId, addr); } }
/** * Issue messages to request the remote subscription table from each server in the cluster (except this one). * @param destinationId the destination ID */ public void initRemoteSubscriptions(String destinationId) { ClusterManager clm = getMessageBroker().getClusterManager(); String serviceType = getClass().getName(); MessageDestination dest = (MessageDestination) getDestination(destinationId); Cluster cluster = clm.getCluster(serviceType, destinationId); if (cluster != null) cluster.addRemoveNodeListener(dest.getRemoteSubscriptionManager()); List members = clm.getClusterMemberAddresses(serviceType, destinationId); for (int i = 0; i < members.size(); i++) { Object addr = members.get(i); if (!clm.getLocalAddress(serviceType, destinationId).equals(addr)) requestSubscriptions(destinationId, addr); } }
/** * Issue messages to request the remote subscription table from each server in the cluster (except this one). * @param destinationId the destination ID */ public void initRemoteSubscriptions(String destinationId) { ClusterManager clm = getMessageBroker().getClusterManager(); String serviceType = getClass().getName(); MessageDestination dest = (MessageDestination) getDestination(destinationId); Cluster cluster = clm.getCluster(serviceType, destinationId); if (cluster != null) cluster.addRemoveNodeListener(dest.getRemoteSubscriptionManager()); List members = clm.getClusterMemberAddresses(serviceType, destinationId); for (int i = 0; i < members.size(); i++) { Object addr = members.get(i); if (!clm.getLocalAddress(serviceType, destinationId).equals(addr)) requestSubscriptions(destinationId, addr); } }
public void start() ClusterManager clm = getMessageBroker().getClusterManager();
ClusterManager clm = getMessageBroker().getClusterManager(); if (destination.getServerSettings().isBroadcastRoutingMode())
ClusterManager clm = getMessageBroker().getClusterManager(); clm.invokePeerToPeerOperation(getClass().getName(), destinationId, ClusterManager.OPERATION_RECEIVE_SUBSCRIPTIONS, new Object[] { destinationId, subscriptions }, remoteAddress);
ClusterManager clm = getMessageBroker().getClusterManager();
ClusterManager clm = getMessageBroker().getClusterManager();
return; ClusterManager clm = getMessageBroker().getClusterManager(); if (destination.getServerSettings().isBroadcastRoutingMode())
return; ClusterManager clm = getMessageBroker().getClusterManager(); if (destination.getServerSettings().isBroadcastRoutingMode())
if (filterSender && headers.containsKey(FlexHeaders.FLEX_CLIENT_ID)) { Set<Object> subscribers = new HashSet<Object>(this.subscriberIds); FlexClient flexClient = messageService.getMessageBroker().getFlexClientManager().getFlexClient(headers.get(FlexHeaders.FLEX_CLIENT_ID).toString()); for (Object subscriberId : this.subscriberIds) { if (flexClient.getMessageClient(subscriberId.toString()) != null) {
/** * Creates a <code>MessageDestination</code> instance, sets its id, sets it manageable * if the <code>AbstractService</code> that created it is manageable, * and sets its <code>Service</code> to the <code>AbstractService</code> that * created it. * * @param id The id of the <code>MessageDestination</code>. * @return The <code>Destination</code> instanced created. */ @Override public Destination createDestination(String id) { if (id == null) { // Cannot add ''{0}'' with null id to the ''{1}'' ConfigurationException ex = new ConfigurationException(); ex.setMessage(ConfigurationConstants.NULL_COMPONENT_ID, new Object[]{"Destination", "Service"}); throw ex; } // check with the message broker to make sure that no destination with the id already exists getMessageBroker().isDestinationRegistered(id, getId(), true); MessageDestination destination = new MessageDestination(); destination.setId(id); destination.setManaged(isManaged()); destination.setService(this); return destination; }
/** * Creates a <code>MessageDestination</code> instance, sets its id, sets it manageable * if the <code>AbstractService</code> that created it is manageable, * and sets its <code>Service</code> to the <code>AbstractService</code> that * created it. * * @param id The id of the <code>MessageDestination</code>. * @return The <code>Destination</code> instanced created. */ @Override public Destination createDestination(String id) { if (id == null) { // Cannot add ''{0}'' with null id to the ''{1}'' ConfigurationException ex = new ConfigurationException(); ex.setMessage(ConfigurationConstants.NULL_COMPONENT_ID, new Object[]{"Destination", "Service"}); throw ex; } // check with the message broker to make sure that no destination with the id already exists getMessageBroker().isDestinationRegistered(id, getId(), true); MessageDestination destination = new MessageDestination(); destination.setId(id); destination.setManaged(isManaged()); destination.setService(this); return destination; }
Log.getLogger(MessageService.LOG_CATEGORY).debug("Routing message to FlexClient id:" + client.getFlexClient().getId() + "', MessageClient id: " + client.getClientId()); getMessageBroker().routeMessageToMessageClient(messageForClient, client);