Search in sources :

Example 6 with JMSException

use of javax.jms.JMSException in project perun by CESNET.

the class SystemQueueProcessor method startProcessingSystemMessages.

public void startProcessingSystemMessages() {
    connection = null;
    try {
        // Step 2. Instantiate the TransportConfiguration object which
        // contains the knowledge of what transport to use,
        // The server port etc.
        log.debug("Creating transport configuration...");
        Map<String, Object> connectionParams = new HashMap<String, Object>();
        if (log.isDebugEnabled()) {
            log.debug("Gonna connect to the host[" + dispatcherPropertiesBean.getProperty("dispatcher.ip.address") + "] on port[" + dispatcherPropertiesBean.getProperty("dispatcher.port") + "]...");
        }
        connectionParams.put(TransportConstants.PORT_PROP_NAME, Integer.parseInt(dispatcherPropertiesBean.getProperty("dispatcher.port")));
        connectionParams.put(TransportConstants.HOST_PROP_NAME, dispatcherPropertiesBean.getProperty("dispatcher.ip.address"));
        TransportConfiguration transportConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getName(), connectionParams);
        // Step 3 Directly instantiate the JMS ConnectionFactory object
        // using that TransportConfiguration
        log.debug("Creating connection factory...");
        cf = (ConnectionFactory) HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transportConfiguration);
        ((HornetQConnectionFactory) cf).setUseGlobalPools(false);
        // Step 4.Create a JMS Connection
        log.debug("Creating connection...");
        connection = cf.createConnection();
        // Step 5. Create a JMS Session
        log.debug("Creating session...");
        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        // Step 10. Start the Connection
        log.debug("Starting connection...");
        connection.start();
        if (processingMessages) {
            systemQueueReceiver.stop();
        }
        systemQueueReceiver.setUp("systemQueue", session);
        log.debug("Executor: taskExecutor.execute(systemQueueReceiver)...");
        taskExecutor.execute(systemQueueReceiver);
        log.debug("Initialization done.");
        processingMessages = true;
    } catch (JMSException e) {
        // If unable to connect to the server...
        log.error("Connection failed. \nThis is weird...are you sure that the Perun-Dispatcher is running on host[" + dispatcherPropertiesBean.getProperty("dispatcher.ip.address") + "] on port[" + dispatcherPropertiesBean.getProperty("dispatcher.port") + "] ? \nSee: perun-dispatcher.properties. We gonna wait 5 sec and try again...", e);
        throw new RuntimeException(e);
    } catch (Exception e) {
        log.error(e.toString(), e);
    }
}
Also used : HornetQConnectionFactory(org.hornetq.jms.client.HornetQConnectionFactory) NettyConnectorFactory(org.hornetq.core.remoting.impl.netty.NettyConnectorFactory) HashMap(java.util.HashMap) TransportConfiguration(org.hornetq.api.core.TransportConfiguration) JMSException(javax.jms.JMSException) MessageFormatException(cz.metacentrum.perun.dispatcher.exceptions.MessageFormatException) JMSException(javax.jms.JMSException) PerunHornetQServerException(cz.metacentrum.perun.dispatcher.exceptions.PerunHornetQServerException)

Example 7 with JMSException

use of javax.jms.JMSException in project perun by CESNET.

the class PropagationMaintainerImpl method checkFinishedTasks.

/*
	 * private void checkProcessingTasks() {
	 * log.info("Gonna list tasks in PROCESSING...");
	 *
	 * for(Task task: schedulingPool.getProcessingTasks()) {
	 * if(task.getExecService
	 * ().getExecServiceType().equals(ExecService.ExecServiceType.GENERATE))
	 * continue; log.info("Gonna check results for Task ID:" + task.getId());
	 *
	 * }
	 *
	 * for (Task task : taskManager.listAllTasksInState(TaskStatus.PROCESSING,
	 * Integer.parseInt(propertiesBean.getProperty("engine.unique.id")))) {
	 * //skip GEN tasks
	 * if(task.getExecService().getExecServiceType().equals(ExecService
	 * .ExecServiceType.GENERATE)) continue;
	 * log.info("Gonna check results for Task ID:" + task.getId());
	 *
	 * List<TaskResult> taskResults =
	 * taskResultDao.getTaskResultsByTask(task.getId());
	 *
	 * List<Destination> destinations = null; try { destinations =
	 * Rpc.ServicesManager.getDestinations(engineManager.getRpcCaller(),
	 * task.getExecService().getService(), task.getFacility()); }
	 * catch(InternalErrorException ex) {
	 * log.error("Can't get destinations. Switching task to ERROR. Cause: {}",
	 * ex); task.setStatus(TaskStatus.ERROR); task.setEndTime(new
	 * Date(System.currentTimeMillis())); taskManager.updateTask(task,
	 * Integer.parseInt(propertiesBean.getProperty("engine.unique.id"))); }
	 * catch(PrivilegeException ex) {
	 * log.error("Can't get destinations. Switching task to ERROR. Cause: {}",
	 * ex); task.setStatus(TaskStatus.ERROR); task.setEndTime(new
	 * Date(System.currentTimeMillis())); taskManager.updateTask(task,
	 * Integer.parseInt(propertiesBean.getProperty("engine.unique.id"))); }
	 * catch(ServiceNotExistsException ex) {
	 * log.error("Service for the task no longer exists. Removing task", ex);
	 * taskManager.removeTask(task.getId(),
	 * Integer.parseInt(propertiesBean.getProperty("engine.unique.id"))); }
	 * catch(FacilityNotExistsException ex) {
	 * log.error("Facility for the task no longer exists. Removing task", ex);
	 * taskManager.removeTask(task.getId(),
	 * Integer.parseInt(propertiesBean.getProperty("engine.unique.id"))); }
	 *
	 * switch(task.getType()) {
	 *
	 * case SERIAL: collectSerialTaskResults(task, taskResults, destinations);
	 * break;
	 *
	 * case PARALLEL: collectParallelTaskResults(task, taskResults,
	 * destinations); break;
	 *
	 * default: log.error("Unknown task type. Assuming parallel.");
	 * collectParallelTaskResults(task, taskResults, destinations); break; } } }
	 *
	 *
	 * private void collectSerialTaskResults(Task task, List<TaskResult>
	 * taskResults, List<Destination> destinations) { if (taskResults.size() <=
	 * destinations.size()) { // Let's check whether they are all DONE or not...
	 * int amountDone = 0; int amountDenied = 0; int amountError = 0; int
	 * amountFatalError = 0; for (TaskResult taskResult : taskResults) { switch
	 * (taskResult.getStatus()) { case DONE: amountDone++; break; case DENIED:
	 * amountDenied++; break; case ERROR: amountError++; break; case
	 * FATAL_ERROR: amountFatalError++; break; default: throw new
	 * IllegalArgumentException("WTF?! " + taskResult.getStatus().toString()); }
	 * }
	 *
	 * if (amountDone > 0) { // Super, at least one task is DONE.
	 * log.info("Task ID " + task.getId() +
	 * " has one Tasks_result DONE, so we set it as DONE.");
	 * task.setStatus(TaskStatus.DONE); task.setEndTime(new
	 * Date(System.currentTimeMillis())); taskManager.updateTask(task,
	 * Integer.parseInt(propertiesBean.getProperty("engine.unique.id")));
	 *
	 * //Set its GENERATE dependencies as dirty //TODO: Hmm...what to do in case
	 * of exceptions?
	 *
	 * try { log.info("I am going to set all ExecService " +
	 * task.getExecServiceId() + " dependencies (the GENERATE ones) to NONE.");
	 * setAllGenerateDependenciesToNone
	 * (dependenciesResolver.listDependencies(task.getExecServiceId()),
	 * task.getFacilityId()); } catch (ServiceNotExistsException e) {
	 * log.error(e.toString(), e); } catch (InternalErrorException e) {
	 * log.error(e.toString(), e); } catch (PrivilegeException e) {
	 * log.error(e.toString(), e); } } else { //TODO Now FATAL_ERROR and ERROR
	 * are being treated exactly the same. Is FATAL_ERROR really necessary? //
	 * Not DONE yet, are there any destinations left? if (taskResults.size() ==
	 * destinations.size()) { // Well, we ended in ERROR... log.info(
	 * "There has been no DONE state Tasks_results, so I am going to set the Task ID"
	 * + task.getId() + " to ERROR."); task.setStatus(TaskStatus.ERROR);
	 * task.setEndTime(new Date(System.currentTimeMillis()));
	 * taskManager.updateTask(task,
	 * Integer.parseInt(propertiesBean.getProperty("engine.unique.id"))); //Set
	 * its GENERATE dependencies as dirty //TODO: Hmm...what to do in case of
	 * exceptions?
	 *
	 * try {
	 * setAllGenerateDependenciesToNone(dependenciesResolver.listDependencies
	 * (task.getExecServiceId()), task.getFacilityId()); } catch
	 * (ServiceNotExistsException e) { log.error(e.toString(), e); } catch
	 * (InternalErrorException e) { log.error(e.toString(), e); } catch
	 * (PrivilegeException e) { log.error(e.toString(), e); } } else { // There
	 * are some destinations left to try, schedule it back
	 * task.setStatus(TaskStatus.PLANNED); task.setSchedule(new
	 * Date(System.currentTimeMillis())); taskManager.updateTask(task,
	 * Integer.parseInt(propertiesBean.getProperty("engine.unique.id"))); } } }
	 * else if (taskResults.size() > destinations.size()) { log.error(
	 * "There are more Task_results then destinations. so I am going to set the Task ID"
	 * + task.getId() + " to ERROR."); task.setStatus(TaskStatus.ERROR);
	 * task.setEndTime(new Date(System.currentTimeMillis()));
	 * taskManager.updateTask(task,
	 * Integer.parseInt(propertiesBean.getProperty("engine.unique.id"))); //Set
	 * its GENERATE dependencies as dirty //TODO: Hmm...what to do in case of
	 * exceptions? try {
	 * setAllGenerateDependenciesToNone(dependenciesResolver.listDependencies
	 * (task.getExecServiceId()), task.getFacilityId()); } catch
	 * (ServiceNotExistsException e) { log.error(e.toString(), e); } catch
	 * (InternalErrorException e) { log.error(e.toString(), e); } catch
	 * (PrivilegeException e) { log.error(e.toString(), e); } }
	 *
	 * if(false) { final long THREE_HOUR = 1000 * 60 * 60 * 3; long
	 * timeDifference = System.currentTimeMillis() -
	 * task.getStartTime().getTime(); if(timeDifference > THREE_HOUR) { // //
	 * WARNING!! // // This can be dangerous. We are not sure if there isn't any
	 * slave script running for this task. // log.error("There are only " +
	 * taskResults.size() + " Task_results for Task ID" + task.getId() +
	 * ", but task is in processing too long, so switch task to ERROR");
	 * task.setStatus(TaskStatus.ERROR); task.setEndTime(new
	 * Date(System.currentTimeMillis())); taskManager.updateTask(task,
	 * Integer.parseInt(propertiesBean.getProperty("engine.unique.id"))); //Set
	 * its GENERATE dependencies as dirty //TODO: Hmm...what to do in case of
	 * exceptions? try {
	 * setAllGenerateDependenciesToNone(dependenciesResolver.listDependencies
	 * (task.getExecServiceId()), task.getFacilityId()); } catch
	 * (ServiceNotExistsException e) { log.error(e.toString(), e); } catch
	 * (InternalErrorException e) { log.error(e.toString(), e); } catch
	 * (PrivilegeException e) { log.error(e.toString(), e); } }
	 *
	 * log.info("There are only " + taskResults.size() +
	 * " Task_results for Task ID" + task.getId() +
	 * ", so we ain't gonna do anything."); // Well, we ain't gonna do anything
	 * bro... // TODO: Time out... } }
	 *
	 * private void collectParallelTaskResults(Task task, List<TaskResult>
	 * taskResults, List<Destination> destinations) { // Do we have the same
	 * number of Destinations as we have TaskResults? if (taskResults.size() ==
	 * destinations.size()) { // Let's check whether they are all DONE or not...
	 * int amountDone = 0; int amountDenied = 0; int amountError = 0; int
	 * amountFatalError = 0; for (TaskResult taskResult : taskResults) { switch
	 * (taskResult.getStatus()) { case DONE: amountDone++; break; case DENIED:
	 * amountDenied++; break; case ERROR: amountError++; break; case
	 * FATAL_ERROR: amountFatalError++; break; default: throw new
	 * IllegalArgumentException("WTF?! " + taskResult.getStatus().toString()); }
	 * }
	 *
	 * if (amountDone + amountDenied == taskResults.size()) { // Super, all is
	 * DONE or we don't care (DENIED) :-) log.info("Task ID " + task.getId() +
	 * " has all Tasks_results either DONE or DENIED, so we set it as DONE.");
	 * task.setStatus(TaskStatus.DONE); task.setEndTime(new
	 * Date(System.currentTimeMillis())); taskManager.updateTask(task,
	 * Integer.parseInt(propertiesBean.getProperty("engine.unique.id")));
	 *
	 * //Set its GENERATE dependencies as dirty //TODO: Hmm...what to do in case
	 * of exceptions? try { log.info("I am going to set all ExecService " +
	 * task.getExecServiceId() + " dependencies (the GENERATE ones) to NONE.");
	 *
	 * setAllGenerateDependenciesToNone(dependenciesResolver.listDependencies(task
	 * .getExecServiceId()), task.getFacilityId()); } catch
	 * (ServiceNotExistsException e) { log.error(e.toString(), e); } catch
	 * (InternalErrorException e) { log.error(e.toString(), e); } catch
	 * (PrivilegeException e) { log.error(e.toString(), e); } } else { final
	 * long TWO_HOUR = 1000 * 60 * 60 * 2; long timeDifference =
	 * System.currentTimeMillis() - task.getStartTime().getTime();
	 * if(timeDifference > TWO_HOUR) { // // WARNING!! // // This can be
	 * dangerous. We are not sure if there isn't any slave script running for
	 * this task. // log.error("There are only " + taskResults.size() +
	 * " Task_results for Task ID" + task.getId() +
	 * ", but task is in processing too long, so switch task to ERROR");
	 * task.setStatus(TaskStatus.ERROR); task.setEndTime(new
	 * Date(System.currentTimeMillis())); taskManager.updateTask(task,
	 * Integer.parseInt(propertiesBean.getProperty("engine.unique.id"))); //Set
	 * its GENERATE dependencies as dirty //TODO: Hmm...what to do in case of
	 * exceptions? try {
	 * setAllGenerateDependenciesToNone(dependenciesResolver.listDependencies
	 * (task.getExecServiceId()), task.getFacilityId()); } catch
	 * (ServiceNotExistsException e) { log.error(e.toString(), e); } catch
	 * (InternalErrorException e) { log.error(e.toString(), e); } catch
	 * (PrivilegeException e) { log.error(e.toString(), e); } } } } else if
	 * (taskResults.size() > destinations.size()) { log.error(
	 * "There are more Task_results then destinations. so I am going to set the Task ID"
	 * + task.getId() + " to ERROR."); task.setStatus(TaskStatus.ERROR);
	 * task.setEndTime(new Date(System.currentTimeMillis()));
	 * taskManager.updateTask(task,
	 * Integer.parseInt(propertiesBean.getProperty("engine.unique.id"))); //Set
	 * its GENERATE dependencies as dirty //TODO: Hmm...what to do in case of
	 * exceptions? try {
	 * setAllGenerateDependenciesToNone(dependenciesResolver.listDependencies
	 * (task.getExecServiceId()), task.getFacilityId()); } catch
	 * (ServiceNotExistsException e) { log.error(e.toString(), e); } catch
	 * (InternalErrorException e) { log.error(e.toString(), e); } catch
	 * (PrivilegeException e) { log.error(e.toString(), e); } } else { final
	 * long THREE_HOUR = 1000 * 60 * 60 * 3; long timeDifference =
	 * System.currentTimeMillis() - task.getStartTime().getTime();
	 * if(timeDifference > THREE_HOUR) { // // WARNING!! // // This can be
	 * dangerous. We are not sure if there isn't any slave script running for
	 * this task. // log.error("There are only " + taskResults.size() +
	 * " Task_results for Task ID" + task.getId() +
	 * ", but task is in processing too long, so switch task to ERROR");
	 * task.setStatus(TaskStatus.ERROR); task.setEndTime(new
	 * Date(System.currentTimeMillis())); taskManager.updateTask(task,
	 * Integer.parseInt(propertiesBean.getProperty("engine.unique.id"))); //Set
	 * its GENERATE dependencies as dirty //TODO: Hmm...what to do in case of
	 * exceptions? try {
	 * setAllGenerateDependenciesToNone(dependenciesResolver.listDependencies
	 * (task.getExecServiceId()), task.getFacilityId()); } catch
	 * (ServiceNotExistsException e) { log.error(e.toString(), e); } catch
	 * (InternalErrorException e) { log.error(e.toString(), e); } catch
	 * (PrivilegeException e) { log.error(e.toString(), e); } }
	 *
	 * log.info("There are only " + taskResults.size() +
	 * " Task_results for Task ID" + task.getId() +
	 * ", so we ain't gonna do anything."); // Well, we ain't gonna do anything
	 * bro... // TODO: Time out... } }
	 */
private void checkFinishedTasks() {
    // report finished tasks back to scheduler
    // clear all tasks we are done with (ie. DONE, ERROR with no recurrence
    // left)
    List<Task> tasklist = schedulingPool.getDoneTasks();
    log.debug("There are {} DONE tasks", tasklist.size());
    for (Task task : tasklist) {
        if (task.getEndTime() == null) {
            log.error("RECOVERY FROM INCONSISTENT STATE: DONE task does not have end_time! Setting end_time to now.");
            Date endTime = new Date(System.currentTimeMillis());
            task.setEndTime(endTime);
        }
        log.debug("TASK " + task.toString() + " finished");
        try {
            log.debug("TASK reported as finished at " + System.currentTimeMillis());
            jmsQueueManager.reportFinishedTask(task, "Destinations []");
            schedulingPool.removeTask(task);
            log.debug("TASK {} removed from database.", task.getId());
        } catch (JMSException e) {
            log.error("Failed to report finished task " + task.toString() + ": " + e.getMessage());
        }
    }
    tasklist = schedulingPool.getErrorTasks();
    log.debug("There are {} ERROR tasks", tasklist.size());
    for (Task task : tasklist) {
        if (task.getEndTime() == null) {
            log.error("RECOVERY FROM INCONSISTENT STATE: ERROR task does not have end_time! Setting end_time to task.getDelay + 1.");
            // getDelay is in minutes, therefore we multiply it with 60*1000
            Date endTime = new Date(System.currentTimeMillis() - ((task.getDelay() + 1) * 60000));
            task.setEndTime(endTime);
        }
        List<Destination> destinations = taskStatusManager.getTaskStatus(task).getSuccessfulDestinations();
        List<Destination> failedDestinations = task.getDestinations();
        failedDestinations.removeAll(destinations);
        StringBuilder destinations_s = new StringBuilder("Destinations [");
        if (!failedDestinations.isEmpty()) {
            destinations_s.append(failedDestinations.remove(0).serializeToString());
            for (Destination destination : failedDestinations) {
                destinations_s.append(",");
                destinations_s.append(destination.serializeToString());
            }
        }
        destinations_s.append("]");
        log.debug("TASK " + task.toString() + " finished in error, remaining destinations: " + destinations_s);
        try {
            jmsQueueManager.reportFinishedTask(task, destinations_s.toString());
            schedulingPool.removeTask(task);
            log.debug("TASK {} removed from database.", task.getId());
        } catch (JMSException e) {
            log.error("Failed to report finished task " + task.toString() + ": " + e.getMessage());
        }
    }
}
Also used : Destination(cz.metacentrum.perun.core.api.Destination) Task(cz.metacentrum.perun.taskslib.model.Task) JMSException(javax.jms.JMSException) Date(java.util.Date)

Example 8 with JMSException

use of javax.jms.JMSException in project ACS by ACS-Community.

the class ACSJMSTopicPublisher method publish.

/* (non-Javadoc)
	 * @see javax.jms.TopicPublisher#publish(javax.jms.Topic, javax.jms.Message)
	 */
public void publish(Topic topic, Message message) throws JMSException {
    if (message == null) {
        throw new NullPointerException("The message can't be null");
    }
    if (topic == null) {
        throw new NullPointerException("The topic can't be null");
    }
    if (topic.getTopicName() == null || topic.getTopicName().isEmpty()) {
        throw new IllegalArgumentException("Invalid topic name");
    }
    PublisherPoolItem item;
    synchronized (publishersPool) {
        item = publishersPool.get(topic.getTopicName());
    }
    if (item == null) {
        try {
            item = new PublisherPoolItem(topic.getTopicName(), containerServices);
        } catch (Exception e) {
            throw new JMSException("Error creating an AcsEventPublisher");
        }
        synchronized (publishersPool) {
            publishersPool.put(topic.getTopicName(), item);
        }
    }
    item.sendMessage(message);
}
Also used : JMSException(javax.jms.JMSException) JMSException(javax.jms.JMSException) AcsJException(alma.acs.exceptions.AcsJException)

Example 9 with JMSException

use of javax.jms.JMSException in project ACS by ACS-Community.

the class DefaultSubscriberImpl method publishKeepAliveNotifications.

/**
   * Method publishKeepAliveNotifications
   *
   */
private void publishKeepAliveNotifications() {
    cat.debug("publishKeepAliveNotifications()");
    if (connection.isConnected()) {
        SubscriptionHandle handle = null;
        Collection local_subscribers = null;
        synchronized (subscribers) {
            local_subscribers = ((Map) subscribers.clone()).values();
        }
        try {
            Iterator iterator = local_subscribers.iterator();
            while (iterator.hasNext()) {
                handle = (SubscriptionHandle) iterator.next();
                if (!NotificationHelper.isNotification(handle.getSubscriptionTopic())) {
                    publishNotification(NotificationHelper.CONSUMER_ALIVE_NOTIFICATION, handle);
                }
            }
        } catch (JMSException je) {
            cat.error("unable to publish keep alive notifications", je);
        }
    }
}
Also used : Iterator(java.util.Iterator) Collection(java.util.Collection) JMSException(javax.jms.JMSException)

Example 10 with JMSException

use of javax.jms.JMSException in project ACS by ACS-Community.

the class DefaultSubscriberImpl method subscribe.

/**
   * Method subscribe
   *
   *
   * @param topic
   * @param listener
   * @param selector
   *
   * @return long the subscription handle identifier
   *
   * @throws JMSException
   * @throws NamingException
   *
   */
public long subscribe(String topic, SubscriptionListener listener, String selector) throws JMSException, NamingException {
    cat.info("subscribe(" + topic + ", listener, " + selector + ")");
    if (closed) {
        throw (new JMSException("Subscriber closed."));
    }
    SubscriptionHandle handle = new SubscriptionHandle();
    handle.setSubscriptionTopic(topic);
    handle.setSubscriptionSelector(selector);
    handle.setSubscriptionListener(listener);
    StringBuffer local_selector = new StringBuffer();
    if (NotificationHelper.isNotification(topic)) {
        // this is a subscription to notifications, no further selection is required
        local_selector.append(selector);
    } else {
        // subscription to a generic topic, adding subscriber specific selection
        if (selector != null) {
            local_selector.append(selector);
            local_selector.append(" AND ");
        }
        local_selector.append("( (");
        local_selector.append(NotificationHelper.SUBSCRIPTION_ID_PROPERTY);
        local_selector.append(" IS NULL) OR (");
        local_selector.append(NotificationHelper.SUBSCRIPTION_ID_PROPERTY);
        local_selector.append(" = '");
        local_selector.append(subscriberId);
        local_selector.append("@");
        local_selector.append(handle.getSubscriptionToken());
        local_selector.append("') )");
    }
    TopicSession session = null;
    TopicSubscriber subscriber = null;
    Topic the_topic = createTopic(topic);
    try {
        session = connection.createTopicSession();
        subscriber = session.createSubscriber(the_topic, local_selector.toString(), false);
    } catch (JMSSecurityException jse) {
        cat.error("JMSSecurityException caught");
        throw (new NamingException(jse.getMessage()));
    } catch (JMSException je) {
        cat.error("JMSException caught");
        throw (new NamingException(je.getMessage()));
    } catch (ConnectionException ce) {
        cat.error("ConnectionException caught");
        throw (new JMSException(ce.getMessage()));
    } catch (Exception e) {
        cat.error("Generic exception caught", e);
    }
    subscriber.setMessageListener(listener);
    handle.setSubscriber(subscriber);
    handle.setSession(session);
    synchronized (subscribers) {
        subscribers.put(new Long(handle.getSubscriptionToken()), handle);
    }
    if (!NotificationHelper.isNotification(topic)) {
        publishNotification(NotificationHelper.CONSUMER_OPEN_NOTIFICATION, handle);
    }
    return handle.getSubscriptionToken();
}
Also used : TopicSubscriber(javax.jms.TopicSubscriber) TopicSession(javax.jms.TopicSession) JMSSecurityException(javax.jms.JMSSecurityException) JMSException(javax.jms.JMSException) NamingException(javax.naming.NamingException) Topic(javax.jms.Topic) NamingException(javax.naming.NamingException) JMSException(javax.jms.JMSException) MOMException(cern.cmw.mom.pubsub.MOMException) JMSSecurityException(javax.jms.JMSSecurityException)

Aggregations

JMSException (javax.jms.JMSException)1038 Message (javax.jms.Message)335 Test (org.junit.Test)320 Session (javax.jms.Session)297 TextMessage (javax.jms.TextMessage)288 Connection (javax.jms.Connection)253 MessageProducer (javax.jms.MessageProducer)160 MessageConsumer (javax.jms.MessageConsumer)148 Destination (javax.jms.Destination)99 ObjectMessage (javax.jms.ObjectMessage)98 Queue (javax.jms.Queue)93 MapMessage (javax.jms.MapMessage)66 ConnectionFactory (javax.jms.ConnectionFactory)63 CountDownLatch (java.util.concurrent.CountDownLatch)61 IOException (java.io.IOException)59 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)53 BytesMessage (javax.jms.BytesMessage)52 MessageListener (javax.jms.MessageListener)50 MessageFormatException (javax.jms.MessageFormatException)43 HashMap (java.util.HashMap)40