Package org.apache.oozie.jms

Examples of org.apache.oozie.jms.ConnectionContext.createSession()


        wfEventListener.init(conf);
        WorkflowJobEvent wfe = new WorkflowJobEvent("wfId1", "caId1", WorkflowJob.Status.FAILED, "user_1",
                "wf-app-name1", new Date(), new Date());
        ConnectionContext jmsContext = getConnectionContext();
        try {
            Session session = jmsContext.createSession(Session.AUTO_ACKNOWLEDGE);
            String selector = JMSHeaderConstants.USER + "='user_1'";
            MessageConsumer consumer = jmsContext.createConsumer(session, wfEventListener.getTopic(wfe), selector);
            wfEventListener.onWorkflowJobEvent(wfe);
            TextMessage message = (TextMessage) consumer.receive(5000);
            WorkflowJobMessage wfFailMessage = JMSMessagingUtils.getEventMessage(message);
View Full Code Here


        wfEventListener.init(conf);
        WorkflowJobEvent wfe = new WorkflowJobEvent("wfId1", "caId1", WorkflowJob.Status.FAILED, "user1",
                "wf-app-name1", new Date(), new Date());
        ConnectionContext jmsContext = getConnectionContext();
        try {
            Session session = jmsContext.createSession(Session.AUTO_ACKNOWLEDGE);
            // Pass a selector which wont match and assert for null message
            String selector = JMSHeaderConstants.USER + "='Non_matching_user'";
            MessageConsumer consumer = jmsContext.createConsumer(session, wfEventListener.getTopic(wfe), selector);
            wfEventListener.onWorkflowJobEvent(wfe);
            TextMessage message = (TextMessage) consumer.receive(5000);
View Full Code Here

        wfEventListener.init(conf);
        WorkflowJobEvent wfe = new WorkflowJobEvent("wfId1", "caId1", WorkflowJob.Status.FAILED, "user1",
                "wf-app-name1", new Date(), new Date());
        ConnectionContext jmsContext = getConnectionContext();
        try {
            Session session = jmsContext.createSession(Session.AUTO_ACKNOWLEDGE);
            // Pass a selector using OR condition
            String selector = JMSHeaderConstants.USER + "='Non_matching_user' OR " + JMSHeaderConstants.APP_NAME
                    + "='wf-app-name1'";
            MessageConsumer consumer = jmsContext.createConsumer(session, wfEventListener.getTopic(wfe), selector);
            wfEventListener.onWorkflowJobEvent(wfe);
View Full Code Here

        wfEventListener.init(conf);
        WorkflowJobEvent wfe = new WorkflowJobEvent("wfId1", "caId1", WorkflowJob.Status.FAILED, "user1",
                "wf-app-name1", new Date(), new Date());
        ConnectionContext jmsContext = getConnectionContext();
        try {
            Session session = jmsContext.createSession(Session.AUTO_ACKNOWLEDGE);
            // Pass a selector using AND condition
            String selector = JMSHeaderConstants.EVENT_STATUS + "='FAILURE' AND " + JMSHeaderConstants.APP_TYPE
                    + "='WORKFLOW_JOB' AND " + JMSHeaderConstants.MESSAGE_TYPE + "='JOB'";
            MessageConsumer consumer = jmsContext.createConsumer(session, wfEventListener.getTopic(wfe), selector);
            wfEventListener.onWorkflowJobEvent(wfe);
View Full Code Here

            broker.start();
            WorkflowJobEvent wfe = new WorkflowJobEvent("wfId1", "caId1", WorkflowJob.Status.FAILED, "user1",
                    "wf-app-name1", new Date(), new Date());

            jmsContext = getConnectionContext();
            Session session = jmsContext.createSession(Session.AUTO_ACKNOWLEDGE);
            MessageConsumer consumer = jmsContext.createConsumer(session, wfEventListener.getTopic(wfe));
            wfEventListener.onWorkflowJobEvent(wfe);
            TextMessage message = (TextMessage) consumer.receive(5000);
            assertNotNull(message);
            broker.stop();
View Full Code Here

        Date nominalTime = DateUtils.parseDateUTC("2011-07-11T00:00Z");
        CoordinatorActionEvent cae = new CoordinatorActionEvent("caId1", "caJobId1", CoordinatorAction.Status.WAITING,
                "user1", "wf-app-name1", nominalTime, startDate, "missingDep1");
        ConnectionContext jmsContext = getConnectionContext();
        try {
            Session session = jmsContext.createSession(Session.AUTO_ACKNOWLEDGE);
            MessageConsumer consumer = jmsContext.createConsumer(session, wfEventListner.getTopic(cae));
            wfEventListner.onCoordinatorActionEvent(cae);
            TextMessage message = (TextMessage) consumer.receive(5000);
            assertFalse(message.getText().contains("endTime"));
            assertFalse(message.getText().contains("errorCode"));
View Full Code Here

        Date nominalTime = DateUtils.parseDateUTC("2011-07-11T00:00Z");
        CoordinatorActionEvent cae = new CoordinatorActionEvent("caId1", "caJobId1", CoordinatorAction.Status.RUNNING,
                "user1", "wf-app-name1", nominalTime, startDate, null);
        ConnectionContext jmsContext = getConnectionContext();
        try {
            Session session = jmsContext.createSession(Session.AUTO_ACKNOWLEDGE);
            MessageConsumer consumer = jmsContext.createConsumer(session, coordEventListener.getTopic(cae));
            coordEventListener.onCoordinatorActionEvent(cae);
            TextMessage message = (TextMessage) consumer.receive(5000);
            assertFalse(message.getText().contains("endTime"));
            assertFalse(message.getText().contains("errorCode"));
View Full Code Here

        CoordinatorActionEvent cae = new CoordinatorActionEvent("caId1", "caJobId1",
                CoordinatorAction.Status.SUCCEEDED, "user1", "wf-app-name1", nominalTime, startDate, null);
        cae.setEndTime(endDate);
        ConnectionContext jmsContext = getConnectionContext();
        try {
            Session session = jmsContext.createSession(Session.AUTO_ACKNOWLEDGE);
            MessageConsumer consumer = jmsContext.createConsumer(session, coordEventListener.getTopic(cae));
            coordEventListener.onCoordinatorActionEvent(cae);
            TextMessage message = (TextMessage) consumer.receive(5000);
            assertFalse(message.getText().contains("errorCode"));
            assertFalse(message.getText().contains("errorMessage"));
View Full Code Here

        cae.setEndTime(endDate);
        cae.setErrorCode("E0101");
        cae.setErrorMessage("dummyError");
        ConnectionContext jmsContext = getConnectionContext();
        try {
            Session session = jmsContext.createSession(Session.AUTO_ACKNOWLEDGE);
            MessageConsumer consumer = jmsContext.createConsumer(session, coordEventListener.getTopic(cae));
            coordEventListener.onCoordinatorActionEvent(cae);
            TextMessage message = (TextMessage) consumer.receive(5000);
            assertFalse(message.getText().contains("missingDependency"));
            CoordinatorActionMessage coordActionFailMessage = JMSMessagingUtils
View Full Code Here

        Date nominalTime = DateUtils.parseDateUTC("2011-07-11T00:00Z");
        CoordinatorActionEvent cae = new CoordinatorActionEvent("caId1", "caJobId1", CoordinatorAction.Status.FAILED,
                "user1", "wf-app-name1", nominalTime, startDate, null);
        ConnectionContext jmsContext = getConnectionContext();
        try {
            Session session = jmsContext.createSession(Session.AUTO_ACKNOWLEDGE);
            String selector = JMSHeaderConstants.USER + "='user1'";
            MessageConsumer consumer = jmsContext.createConsumer(session, coordEventListener.getTopic(cae), selector);
            coordEventListener.onCoordinatorActionEvent(cae);
            TextMessage message = (TextMessage) consumer.receive(5000);
            CoordinatorActionMessage coordActionFailMessage = JMSMessagingUtils
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.