Suspending/Pausing a MDB's Consumption Programmatically

Hey guys
I have come across a lot of forums saying that there are new methods available from Weblogic 9 that enable the suspension of a MDB's consumption but I can not find any examples of it. Does anyone by any chance have an example of this?
I am using Weblogic 10.3. Is it possible? I have been stuck on this for a while now and I really have no where to turn... Java code would be so awesome right now. All I am trying to do is emulate what happens when you click on Suspend MDB in the console of weblogic so that messages can be added to the queue and not get processed then once resumed (maybe from the console) the MDB would carry on processing the messages.
Thanks for any help

Thanks Albert, with your help I have come to a solution
Here is an example of the code I think is the best option:
import java.util.Hashtable;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import javax.naming.Context;
public class StopTheBean implements Runnable{
     public void stopTheBean() {
          Thread runner = new Thread(this);
          runner.start();
     public void run() {
          try {
               String hostname = "127.0.0.1";
               String portString = "7001";
               String username = "weblogic";
               String password = "weblogic";
               String protocol = "t3";
               Integer portInteger = Integer.valueOf(portString);
               int port = portInteger.intValue();
               String jndiroot = "/jndi/";
               String mserver = "weblogic.management.mbeanservers.runtime";
               JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname, port, jndiroot + mserver);
               Hashtable<String, Object> h = new Hashtable<String, Object>();
               h.put(Context.SECURITY_PRINCIPAL, username);
               h.put(Context.SECURITY_CREDENTIALS, password);
               h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, "weblogic.management.remote");
               h.put("jmx.remote.x.request.waiting.timeout", new Long(10000));
               JMXConnector connector = JMXConnectorFactory.connect(serviceURL, h);
               MBeanServerConnection connection = connector.getMBeanServerConnection();
               Hashtable<String, String> prop = new Hashtable<String, String>();
               prop.put("Name", "SuspendBean_SORBModule!SORBOrderRequest_Q");
               prop.put("Type", "MessageDrivenEJBRuntime");
               prop.put("ServerRuntime", "Local_Admin");
               prop.put("ApplicationRuntime", "SuspendMDBEAR");
               prop.put("EJBComponentRuntime", "SuspendMDB.jar");
               ObjectName beanName = new ObjectName("com.bea", prop);
               connection.invoke(beanName, "suspend", null, null);
               System.out.println("MDB Stopped");
               connector.close();
          } catch (Exception e) {
               System.out.println(e.toString());
}Here is another example using a web service instead of a new thread:
import java.util.Hashtable;
import javax.jws.*;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import javax.naming.Context;
@WebService
public class StopTheBean {
     @WebMethod
     public void beginTheSuspend() {
          try {
               String hostname = "127.0.0.1";
               String portString = "7001";
               String username = "weblogic";
               String password = "weblogic";
               String protocol = "t3";
               Integer portInteger = Integer.valueOf(portString);
               int port = portInteger.intValue();
               String jndiroot = "/jndi/";
               String mserver = "weblogic.management.mbeanservers.runtime";
               JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname, port, jndiroot + mserver);
               Hashtable<String, Object> h = new Hashtable<String, Object>();
               h.put(Context.SECURITY_PRINCIPAL, username);
               h.put(Context.SECURITY_CREDENTIALS, password);
               h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, "weblogic.management.remote");
               h.put("jmx.remote.x.request.waiting.timeout", new Long(10000));
               JMXConnector connector = JMXConnectorFactory.connect(serviceURL, h);
               MBeanServerConnection connection = connector.getMBeanServerConnection();
               Hashtable<String, String> prop = new Hashtable<String, String>();
               prop.put("Name", "SuspendBean_SORBModule!SORBOrderRequest_Q");
               prop.put("Type", "MessageDrivenEJBRuntime");
               prop.put("ServerRuntime", "Local_Admin");
               prop.put("ApplicationRuntime", "SuspendMDBEAR");
               prop.put("EJBComponentRuntime", "SuspendMDB.jar");
               ObjectName beanName = new ObjectName("com.bea", prop);
               connection.invoke(beanName, "suspend", null, null);
               System.out.println("MDB Suspended");
               connector.close();
          } catch (Exception e) {
               System.out.println(e.toString());
}First of all, it has to be on its own thread separate from the MDB otherwise the thread will just hang... Secondly I know the context can be used to get the MBeanServer but it gives errors on authorization. That's why it has to be done this way, so that you can set the username and password to be used. The alternative way looks like this for anyone that is interested:
InitialContext ctx = new InitialContext();
MBeanServer server = (MBeanServer) ctx.lookup("java:comp/env/jmx/runtime");And to further this post, these two sections of code return the exact same thing. So if you are struggling with getting the object name of the message bean you can find out what that is with the first of the next two sections of code:
               ObjectName[] bob = (ObjectName[]) server.getAttribute(new ObjectName("com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean"), "Services");
               for (ObjectName objectName : bob) {
                    ObjectName serverrt = (ObjectName) server.getAttribute(objectName, "ServerRuntime");
                    ObjectName[] apprt = (ObjectName[]) server.getAttribute(serverrt, "ApplicationRuntimes");
                    for (ObjectName appName : apprt) {
                         if (appName.toString().contains("SuspendMDBEAR")) {
                              ObjectName[] comprt = (ObjectName[]) server.getAttribute(appName, "ComponentRuntimes");
                              ObjectName[] ejbrt = (ObjectName[]) server.getAttribute(comprt[0], "EJBRuntimes");
                              for (ObjectName ejbName : ejbrt) {
                                   server.invoke(ejbName, "suspend", null, null);
               Hashtable<String, String> prop = new Hashtable<String, String>();
               prop.put("Name", "SuspendBean_SORBModule!SORBOrderRequest_Q");
               prop.put("Type", "MessageDrivenEJBRuntime");
               prop.put("ServerRuntime", "Local_Admin");
               prop.put("ApplicationRuntime", "SuspendMDBEAR");
               prop.put("EJBComponentRuntime", "SuspendMDB.jar");
               ObjectName beanName = new ObjectName("com.bea", prop);
               server.invoke(beanName, "suspend", null, null);I will REPEAT, the immediate above two sections do the exact same thing. Please note, the variable "server" in these two sections of code refers to the MBeanServer.
Here are some useful attributes that can be retrieved from the MDB:
               connection.getAttribute(beanName, "ConnectionStatus");
               connection.getAttribute(beanName, "Destination");
               connection.getAttribute(beanName, "EJBName");
               connection.getAttribute(beanName, "HealthState");
               connection.getAttribute(beanName, "JmsClientID");
               connection.getAttribute(beanName, "JMSConnectionAlive");
               connection.getAttribute(beanName, "LastException");
               connection.getAttribute(beanName, "LastExceptionAsString");
               connection.getAttribute(beanName, "MDBStatus");
               connection.getAttribute(beanName, "Name");
               connection.getAttribute(beanName, "Parent");
               connection.getAttribute(beanName, "ProcessedMessageCount");
               connection.getAttribute(beanName, "SuspendCount");
               connection.getAttribute(beanName, "Type");I think they all return as Strings. Just check it before you use it!
I hope this helps anyone that was in my position!
ENJOY

Similar Messages

  • WLST & suspending/resuming a MDB

    Hi all,
    I'm using WLS 10.3 and I need to write a WLST script for suspending/resuming a MDB packaged within an EAR file.
    The EAR file contains more MDBs and I need to suspend/resume selected MDBs.
    I tried to use the 'record' feature from WLS console but it doesn't register anything.
    Could you please give me any hint ?
    Thanks in advance
    ferp

    Hi Mody,
    having a look through the Oracle Knowledge I've found the below article:
    How to Suspend / Resume an MDB from Java code and WLST script? [ID 1079590.1]
    So you can suspend one individual MDB from an EAR file if your EAR contains multiple MDBs:
    connect('username','password','t3://host:port')
    domainRuntime()
    cd('/ServerRuntimes/TargetServerName/ApplicationRuntimes/ApplicationDeploymentName/ComponentRuntimes/ApplicationDeploymentName/EJBRuntimes/MDBName_JNDINameoftheQueue')
    cmo.suspend() or cmo.resume()
    As I'm not expert in WLST now I'm trying to adapt the above code to my scenario but I've some troubles to select only some given MDBs and interacting over that list:
    cd('/ServerRuntimes/TargetServerName/ApplicationRuntimes/ApplicationDeploymentName/ComponentRuntimes/ApplicationDeploymentName/EJBRuntimes')
    ls()
    --> I get
    dr-- ADV_FFOutMDB_001_OUT
    dr-- ADV_FFOutMDB_002_OUT
    dr-- BB_FFInMDB_IN
    dr-- CRR_FFOutMDB_OUT
    I'm trying to select only ones that ends in _OUT and then suspend them:
    cd('/ServerRuntimes/TargetServerName/.../EJBRuntimes')
    myList = .... how I could get it ?
    for item in myList:
    cd(item)
    cmo.suspend()
    Do you have any example or hint ?
    Thanks for your help
    ferp

  • Re: Pause a MDB?

    Variation of (2): Additionally configure a
              redelivery delay on the destination (via the console or mbeans). This
              reduces spin, but is not viable if the queue sees heavy use (many messages
              per second), or if message order is important.
              Or (3) have MDB "pause" itself using "wait()" or "sleep()". (Just make
              very
              sure that the MDB pool size is smaller than the execute thread pool size,
              or you will run out of threads.)
              Tom
              Bill Nixon wrote:
              > I have an application that consume messages from a JMS queue via a
              > MDB. At certain times, I'd like to be able to pause the MDB or queue,
              > i.e. stop the container from invoking onMessage(). Once some critical
              > processing has completed, I'd like to unpause.
              >
              > Two solutions that we have tossed around are:
              >
              > 1. Undeploy and then redeploy the MDB. (Not very elegant or production
              > ready).
              >
              > 2. In onMessage(), using a Read-Mostly Entity Bean, check for the
              > condition and if "pausing" then don't acknowledge the message, forcing
              > the message to be redelivered. (Bad design that conceptually is a busy
              > wait).
              >
              > Any other options or suggestions?
              >
              > Thanks in advance.
              

              Peter Lee wrote:
              > Have you tried using JMX to call weblogic.management.runtime.
              > JMSDestinationRuntimeMBean.pause()/resume()?
              This prevents sends, not receives, and so doesn't apply here.
              >
              > If you are integrating with foreign JMS providers via the message bridge,
              > you can use weblogic.management.runtime.RuntimeMBean.
              > MessagingBridgeRuntimeMBean.start()/stop(), or you may find that you
              > need to call weblogic.management.configuration.MessagingBridgeMBean.
              > setEnabled(boolean).
              Good point.
              >
              > Srini <[email protected]> wrote:
              >
              >>Hi Tom,
              >>
              >>Do you know if this (Pausing the MDB) is implemented, or not yet? If
              >>it's implemented, can you please indicate the version?
              >>
              >>Anyone else has any better solution apart from introducing a wait or
              >>sleep (assuming that BEA has not implemented this enhancement as yet)?
              >>
              >>
              >>Please help!
              >>Srini
              >
              >
              

  • MDB Suspend/Resume server startup

    Hello All,
    We have a requirement where we want to stop MDBs from starting even after server restart. We have tried the following
    In MDB control page in Admin Console there is a feature in WLS where we can Suspend/Resume MDBs from consuming
    messages. Once we suspend the MDB it is stopping the consumption of the messages for that session, however when
    we restart the server the MDB starts picking up messages from the JMS. Is there a way in WLS to tell the server
    to not start the MDB's if they are in a suspended state during shutdown?
    We have researched the following forum entries and none of them seem to be viable option.
    Setting the initial of MDB as Suspended
    Re: Disable autmatic mdb message process on server start
    We are on WLS 10.3.2, have a foriegn server configuration to Oracle AQ.
    Thanks,
    Prem.

    How about creating a dummy WLS jms queue and a WLS connection factory with the same JNDI names used by the MDB. This will point your mdb to listen to the dummy WLS jms queue consuming no messages. When you need the MDB to do real work , delete the dummy objects and instead create AQ CF and Q via the foreign jms server. Do a suspend/resume of mdb to point it to the AQ queue..

  • Dynamically undeploying MDBs

              Hi,
              I am using Weblogic 6.1 SP4 - Integrating with MQ5.2 using IBM MQ Classes.
              I have an MDB which points to a MQ Queue. MDB takes the message and delegates
              to specific Java Classes which parse the XML (body of the message) into Java Objects
              and save them into database.
              I have implemented Container Managed transactional MDBs. Before processing the
              message I am checking to see if the database connection is available. If the
              database connection is not available, I am rolling back the message into the Queue.
              The problem is that this is getting into a loop, till the database connection
              is available. (MDB picks up the message and checks up for database connectivity
              and rolls back into the queue).
              The solution that I have thought of doing is to check upto 5 times (just a count
              I have decided), after which I will undeploy the MDBs dynamically. Then I will
              start a new Thread (Thread class) which will check if the database connection
              is available and once the connection is available, I will redeploy the MDB to
              process the message again.
              I have following questions here:
              (1) How to dynamically undeploy & re-deploy MDB
              (2) How can I check Redelivered Count. I know that I can use Message.getJMSRedelivered
              (), which will return me a boolean stating the message is redelivered. If I
              can't check for Redelivered count, then if getJMSRedelivered() is "true", then
              I will undeploy the MDB.
              (3) Will there be any issues/problems in the solution discussed above.
              Thanks in advance for any help.
              Regards,
              Venkatesan.
              

    As I wrote below, I think there is a way, but I don't
              know how. For programmatically undeploying the MDB,
              I suggest posting your needs to the "ejb" newsgroup, which has
              more experience in this area. (I mentioned this already
              in another part of this email thread.)
              Tom
              Sastry wrote:
              > Hi Tom,
              >
              > Is there any way to use weblogic 7.0 JMX API's to suspend a MDB so that it won't
              > process any messages from the queue until the next destination like oracle database
              > connection is up and running.
              >
              > Thanks
              > Sastry
              >
              > Tom Barnes <[email protected]> wrote:
              >
              >>9.0 - I don't know the official release date, but I
              >>imagine its in the latter half of 2004. For now,
              >>there is undeploying the MDBs, or shutting down JMS.
              >>
              >>Tom
              >>
              >>Mikhail Stolpner wrote:
              >>
              >>
              >>>Yes. Exactly.
              >>>What next release do you mean? Is it 8.1SP2 or 9.0?
              >>>
              >>>Thank you very much,
              >>>Mikhail
              >>>
              >>>"Tom Barnes" <[email protected]> wrote in message
              >>>news:[email protected]...
              >>>
              >>>
              >>>>Clarification. You can pause "produces", but not "consumes",
              >>>>using the console or programmatically via JMX.
              >>>>I assumed you meant to pause "consumes".
              >>>>
              >>>>Tom Barnes wrote:
              >>>>
              >>>>
              >>>>
              >>>>>Hi Mikhail,
              >>>>>
              >>>>>There is no direct way. In 7.0 and later you can
              >>>>>programmatically shutdown
              >>>>>the entire JMS server, while leaving the WL server up,
              >>>>>by setting the JMS server mbean's "target"
              >>>>>field to null.
              >>>>>
              >>>>>Note that you can have multiple JMS server's per WL
              >>>>>server.
              >>>>>
              >>>>>Tom
              >>>>>
              >>>>>P.S. A rich featured pause capability is planned
              >>>>>for the next release. This includes the ability
              >>>>>to pause an MDB, as well as an entire destination
              >>>>>in various ways.
              >>>>>
              >>>>>Mikhail Stolpner wrote:
              >>>>>
              >>>>>
              >>>>>
              >>>>>>Hi Tom,
              >>>>>>
              >>>>>>Do you know if there is a way to programmatically pause Weblogic
              >>
              >>Queue?
              >>
              >>>>>>Thanks,
              >>>>>>Mikhail
              >>>>>>
              >>>>>>"Tom Barnes" <[email protected]> wrote in message
              >>>>>>news:[email protected]...
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>Hi,
              >>>>>>>
              >>>>>>>A "redelivered count" requires a vendor extension - JMS does
              >>>>>>>not provide one. Check the MQ doc to see if there is one.
              >>>>>>>
              >>>>>>>Another option is programmatically pause MQ - I'm not sure
              >>>>>>>if there is a way to do this. Again - check the MQ doc.
              >>>>>>>
              >>>>>>>Another option is to simply block the MDB in a try/sleep()
              >>>>>>>retry loop until the database connection comes back up.
              >>>>>>>
              >>>>>>>As for programmatically undeploying the MDB, I suggest
              >>>>>>>posting your needs to the "EJB" newsgroup, which has
              >>>>>>>more experience in this area.
              >>>>>>>
              >>>>>>>Tom
              >>>>>>>
              >>>>>>>Venkatesan wrote:
              >>>>>>>
              >>>>>>>
              >>>>>>>
              >>>>>>>
              >>>>>>>>Hi,
              >>>>>>>>I am using Weblogic 6.1 SP4 - Integrating with MQ5.2 using IBM
              >>
              >>MQ
              >>
              >>>>>>
              >>>>>>Classes.
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>>I have an MDB which points to a MQ Queue. MDB takes the message
              >>
              >>and
              >>
              >>>>>>
              >>>>>>delegates
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>>to specific Java Classes which parse the XML (body of the message)
              >>>
              >>>into
              >>>
              >>>
              >>>>>>Java Objects
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>>and save them into database.
              >>>>>>>>I have implemented Container Managed transactional MDBs. Before
              >>>>>>
              >>>>>>
              >>>>>>processing the
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>>message I am checking to see if the database connection is available.
              >>>>>>
              >>>>>>
              >>>>>>If the
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>>database connection is not available, I am rolling back the message
              >>>>>>>>into
              >>>>>>
              >>>>>>
              >>>>>>the Queue.
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>>The problem is that this is getting into a loop, till the database
              >>>>>>
              >>>>>>
              >>>>>>connection
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>>is available. (MDB picks up the message and checks up for database
              >>>>>>
              >>>>>>
              >>>>>>connectivity
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>>and rolls back into the queue).
              >>>>>>>>The solution that I have thought of doing is to check upto 5 times
              >>>>>>>>(just
              >>>>>>
              >>>>>>
              >>>>>>a count
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>>I have decided), after which I will undeploy the MDBs dynamically.
              >>>>>>>>Then
              >>>>>>
              >>>>>>
              >>>>>>I will
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>>start a new Thread (Thread class) which will check if the database
              >>>>>>
              >>>>>>
              >>>>>>connection
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>>is available and once the connection is available, I will redeploy
              >>>
              >>>the
              >>>
              >>>
              >>>>>>MDB to
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>>process the message again.
              >>>>>>>>
              >>>>>>>>I have following questions here:
              >>>>>>>>
              >>>>>>>> (1) How to dynamically undeploy & re-deploy MDB
              >>>>>>>> (2) How can I check Redelivered Count. I know that I can use
              >>>>>>
              >>>>>>
              >>>>>>Message.getJMSRedelivered
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>>(), which will return me a boolean stating the message is
              >>>
              >>>redelivered.
              >>>
              >>>
              >>>>>>If I
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>>can't check for Redelivered count, then if getJMSRedelivered()
              >>
              >>is
              >>
              >>>>>>
              >>>>>>"true", then
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>>I will undeploy the MDB.
              >>>>>>>> (3) Will there be any issues/problems in the solution discussed
              >>>>>>
              >>>>>>
              >>>>>>above.
              >>>>>>
              >>>>>>
              >>>>>>
              >>>>>>>>Thanks in advance for any help.
              >>>>>>>>
              >>>>>>>>Regards,
              >>>>>>>>Venkatesan.
              >>>>>>>>
              >>>>>>>>
              >>>>>>>
              >>>
              >
              

  • How to remove Access 2007 (MDB) project from Team Foundation using VB6/VBA?

    Hi,
    is there any way how to remove A2007 (MDB) project from Team Foundation using VB6 or VBA? CompactDatabase method doesn't seem to help.
    I need to remove back-end MDBs before deploying the whole project. In other words, the MDBs themselves should remain in TF but I'd like to remove their copies that should be deployed (distribution set). I wrote a simple function for compacting MDBs but it
    doesn't do the trick. When I compact an MDB in Access 2007 I'm always asked whether I want to remove it from source control.
    Thank you very much in advance.

    What are the copies you referring?
    These are physical copies of local MDB files. I can't (don't want) to deploy MDB files that are handled by source code control (SCC) since those files hold information about SCC (local directory mapping). Users might not understand the message they get when
    they open such MDB in Access, eg.:
    This database was named 'C:\Projekty\P1\DB\nP01.mdb' but has been moved, copied, or renamed. Source code control features will be disabled.
    That's why I want to remove the SCC information from MDB files. The only way I know so far is to use "Compact & Repair database" in MS Access 2007. I'd like to point you to http://msdn.microsoft.com/en-us/library/aa155494%28v=office.10%29.aspx (it's
    similar to Access 2007 & Team Foundation):
    Using the Compact Database Command
    In order to take a database that is under source code control and deliver it to a user, you need a way to cut the database's ties to source code control. When you compact a database that is under source code control, Microsoft Access 2000 prompts you
    to remove the database from source code control.
    To remove the database from source code control, Microsoft Access simply removes the Visual SourceSafe properties from the Microsoft Access database and its objects.
    I would like to remove Access MDBs from SCC programmatically so that I can
    significantly reduce time that I spend on deploying the application. In one of our applications there are five back-end MDBs that are under SCC and it takes some time to remove them from
    SCC manually. I have to do it anytime we release new version, even for releases that are determined as testing releases for internal testing within our company.
    Thank you very much for your time.

  • Deactivating MDB using JMX

    Hi All,
    I have a requirement to deactivate a MDB from its own onMessage method , when it detects some error.
    This is the piece of code I was using:
    DeployerRuntimeMBean deployer = DeployerRuntime.getDeployerRuntime();
                   deployer.deactivate("MDBName", null, null);
    I was able to pause the MDB by running the above code in our developer environment where there is only the admin server . When I tested this in our UAT environment I was getting a null pointer exception. In UAT environment we are having an admin server + a cluster . There is only a single managed server in the cluster and the MDB is targeted to the cluster.
    Any clue why this error is happening.
    TIA
    -Atheek

    If you need to access this from a managed server, you could use one of
    the getDeployerRuntime methods that connects as a client to the admin
    server:
    http://e-docs.bea.com/wls/docs100/javadocs/weblogic/management/deploy/DeployerRuntime.html
    Tony
    Tony wrote:
    The DeployerRuntimeMBean only exists on the admin server:
    http://e-docs.bea.com/wls/docs100/javadocs_mhome/weblogic/management/runtime/DeployerRuntimeMBean.html
    Tony
    Atheek Rahuman wrote:
    Hi All,
    I have a requirement to deactivate a MDB from its own onMessage method , when it detects some error.
    This is the piece of code I was using:
    DeployerRuntimeMBean deployer = DeployerRuntime.getDeployerRuntime();
                   deployer.deactivate("MDBName", null, null);
    I was able to pause the MDB by running the above code in our developer environment where there is only the admin server . When I tested this in our UAT environment I was getting a null pointer exception. In UAT environment we are having an admin server + a cluster . There is only a single managed server in the cluster and the MDB is targeted to the cluster.
    Any clue why this error is happening.
    TIA
    -Atheek

  • Need suggestion on  implementing JMS message error recovery

    Hi,
    Our application has a JMS topic where we publish application events. Now, there can be scenarios where the consumers cannot process the message due to some infrastructure issues and would error out. We need a way so that those messages can be reprocessed again later. we are thinking of the following design for JMS message error recovery
    1. Use a persistent TOPIC (this would ensure guaranteed delivery)
    2. Configure a error destination on JMS topic e.g a jms queue
    3. Have an error handling MDB listening to the Error destination. An error handling MDB would dequeue the errored messages from error destination and persist it to a Data base "error" table..
    4. Provide a mechanism to republish those messages to topic (e.g a scheduler or admin ui or a command line utility) .. The messages would deleted from database "error" table and published to topic again....
    A. Are there any issues with the above design which we need to handle?
    B. Are there any additional steps required in a Cluster environment with a distributed topic and distribute error destination? (our error mdb will have one-copy-per-application setting)
    B. From a performance angle, Is it OK to use persistent TOPIC ? Or will it better to persist the message to the db table and then publish it as a non persistent message ... ? (But i guess the performance should be more or less the same in both of these approaches)
    C. Are there any other recommended design patterns for error recovery of JMS messages
    Please advise.
    Regards,
    Arif

    Thanks Tom !
    We may not be able to go with the approach of delaying/pausing redelivery of the messsage because
    1. Pausing entire MDB approach: Our MDB application consumes messages generated by different producers and our MDB needs to continue processing the messages even if messages corresponding to one producer is erroring out
    2. Redelivery delay : This would only delay the retry of an errored message. But there would still be a problem if the message fails during all retries (i.e redelivery limit count). We don't want to lose this message. In our case, It is possible that a particular message cannot be processed due to unavailability of a third party system for hours or may be a day.
    Basically, i am looking on approaches for a robust and performant error recovery/retry framework for our application (refer details in my first post on this thread) while fully making use of all features provided by middleware (WLS). Please advise.
    Regards,
    Arif

  • How to develop Ping Service in Oracle Service Bus

    Hi all,
    I want to develop a ping service in OSB which will ping all the End-point URLs and Databases ( i.e It will do the health check of the end point URLs ) .
    when it is found any End Point URL is not reachable it should shutdown all the Osb Projects(or Proxy's) which is using the End-point URL and when ever the
    End-point URL is up it should Bring the Osb Project( or proxy) up to get the requests .
    I want to implement this for Asynchronous services or JMS services.
    Can we shutdown any Proxy or OSB project like BPEL process ??
    Thanks
    Phani

    I want to implement this for Asynchronous services or JMS services. For jms transport, instead of disabling the proxy you can make a java callout to pause the queue for consumption. This should a very small piece of java code using jmx api to pause the consumption.. So instead of designing a 'ping' service, what you can do is when an error occurs on the route node, do the following in the route error handler -
    - Configure an 'alert' action to notify to the support about the issue, This could be done in different ways depending on how your osb is integrated to the problem management system.
    - Pause the queue for consumption using the java callout.
    Support can manually come and resume the consumption on the queue after the issue is fixed.

  • Issue with JMS adapter

    Hi All,
    I am trying to produce a message into JMS queue from BPEL, for this purpose i have created a connection factory, Queue and connection pool inside console and everything is fine. When i am testing the bpel process, I am able to see that message is written into jms queue with the help of payload inside em. But, I am unable to view the same messages inside the queue that I has created, but the property 'Messages High' of the queue is showing the count of messages it received. I dont see any error in logs, Can I know what I am doing wrong here?
    Thanks,

    Hi,
    If there's something consuming the messages you won't be able to see them...
    Go to the weblogic console and pause your queue for consumption in the control tab, publish a message and you will be able to see it on Monitoring tab...
    Cheers,
    Vlad

  • AQ JMS Bridge in WebLogic 9.2

    I have configured a JMS Bridge that has source target as an AQ(which is referred to by a local weblogic jndi name - followed the robert patric framework) and the destination as a JMS queue. I can see the error logs prointed on the adminserver.logs when the bridge is started and the error is printed on and on.
    error log:
    ####<May 25, 2010 1:51:19 PM CDT> <Info> <MessagingBridge> <hostname_replaced> <osmdev03> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1274813479568> <BEA-200033> <Bridge "AQ_2_JMS_WLBridge" is obtaining connections to the two adapters.>
    ####<May 25, 2010 1:51:19 PM CDT> <Trace> <eis/jms/WLSConnectionFactoryJNDIXA> <hostname_replaced> <osmdev03> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1274813479569> <000000> <<May 25, 2010 1:51:19 PM CDT> Info: AQ_2_JMS_WLBridge : Source connection created to AIA_OSM_OUT_QUEUE>
    ####<May 25, 2010 1:51:19 PM CDT> <Trace> <eis/jms/WLSConnectionFactoryJNDIXA> <hostname_replaced> <osmdev03> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1274813479613> <000000> <<May 25, 2010 1:51:19 PM CDT> Info: AQ_2_JMS_WLBridge : Connection started to AIA_OSM_OUT_QUEUE>
    ####<May 25, 2010 1:51:19 PM CDT> <Info> <Common> <hostname_replaced> <osmdev03> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1274813479614> <BEA-000628> <Created "1" resources for pool "eis/jms/WLSConnectionFactoryJNDIXA", out of which "1" are available and "0" are unavailable.>
    ####<May 25, 2010 1:51:19 PM CDT> <Trace> <eis/jms/WLSConnectionFactoryJNDIXA> <hostname_replaced> <osmdev03> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1274813479615> <000000> <<May 25, 2010 1:51:19 PM CDT> Info: null : Target connection created to oracle.communications.ordermanagement.WebServiceQueue>
    ####<May 25, 2010 1:51:19 PM CDT> <Trace> <eis/jms/WLSConnectionFactoryJNDIXA> <hostname_replaced> <osmdev03> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1274813479617> <000000> <<May 25, 2010 1:51:19 PM CDT> Info: null : Connection started to oracle.communications.ordermanagement.WebServiceQueue>
    ####<May 25, 2010 1:51:19 PM CDT> <Info> <Common> <hostname_replaced> <osmdev03> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1274813479618> <BEA-000628> <Created "1" resources for pool "eis/jms/WLSConnectionFactoryJNDIXA", out of which "1" are available and "0" are unavailable.>
    ####<May 25, 2010 1:51:19 PM CDT> <Info> <MessagingBridge> <hostname_replaced> <osmdev03> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1274813479618> <BEA-200032> <Bridge "AQ_2_JMS_WLBridge" is configured to disallow degradation of its quality of service in cases where the configured quality of service is unreachable.>
    ####<May 25, 2010 1:51:19 PM CDT> <Info> <MessagingBridge> <hostname_replaced> <osmdev03> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1274813479618> <BEA-200030> <Bridge "AQ_2_JMS_WLBridge" is configured to work in "Exactly-once" mode, and it is actually working in "Exactly-once" mode.>
    ####<May 25, 2010 1:51:19 PM CDT> <Info> <MessagingBridge> <hostname_replaced> <osmdev03> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1274813479618> <BEA-200028> <The bridge "AQ_2_JMS_WLBridge" has started transferring messages.>
    ####<May 25, 2010 1:51:19 PM CDT> <Trace> <eis/jms/WLSConnectionFactoryJNDIXA> <hostname_replaced> <osmdev03> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1274813479618> <000000> <<May 25, 2010 1:51:19 PM CDT> Error: AQ_2_JMS_WLBridge : Failed to create consumer AIA_OSM_OUT_QUEUE>
    ####<May 25, 2010 1:51:19 PM CDT> <Trace> <eis/jms/WLSConnectionFactoryJNDIXA> <hostname_replaced> <osmdev03> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1274813479619> <000000> <<May 25, 2010 1:51:19 PM CDT> Info: AQ_2_JMS_WLBridge : Connection closed to AIA_OSM_OUT_QUEUE>
    ####<May 25, 2010 1:51:19 PM CDT> <Warning> <MessagingBridge> <hostname_replaced> <osmdev03> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1274813479619> <BEA-200026> <Bridge "AQ_2_JMS_WLBridge" encountered some problems in one of its adapters or underlying systems. It stopped transferring messages and will try to reconnect to the adapters shortly. (The exception caught was javax.resource.ResourceException: Error setting message listener.)>
    ####<May 25, 2010 1:51:19 PM CDT> <Trace> <eis/jms/WLSConnectionFactoryJNDIXA> <hostname_replaced> <osmdev03> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1274813479621> <000000> <<May 25, 2010 1:51:19 PM CDT> Info: null : Connection closed to oracle.communications.ordermanagement.WebServiceQueue>
    ####<May 25, 2010 1:51:19 PM CDT> <Info> <MessagingBridge> <hostname_replaced> <osmdev03> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1274813479621> <BEA-200020> <Bridge "AQ_2_JMS_WLBridge" is stopped.>
    Thanks
    Matt

    Hi Kapil,
              WebLogic JMS doesn't distinguish between "incoming" and "outgoing" queues - they're both application queues as far as WebLogic is concerned. Either queue can be paused/resumed.
              You might interesting in knowing that WL also supports pausing/resuming MDBs both administratively and automatically on failure. For information, see "Configuring Suspension of Message Delivery During JMS Resource Outages" in the MDB developer guide.
              Tom

  • Loading and running consecutive scripts in LabVIEW

    Hello, 
    I'd like to start this by saying that I'm very new to LabVIEW so I apologize for any questions that should seem obvious. Also, when replying please remember I'm not as familiar as I would like to be with LabVIEW in general. I have recently had a problem put on my desk to add some functionality to a preexiting, fairly complex VI. The solution seems to be in scripting. However, loading a script longer than 55 lines gives an error (Is this normal? Is there a way around it?). The problem is pretty easy to break up into small parts, so the script has been broken up into multiple smaller parts that provide the same function when ran consecutively. After executing each script, the system will take some time to process (up to 300ms, IIRC) and will assert a ready bit when complete. Using that ready signal as a trigger, I would like to execute the next script.
    The scripts are being read correctly into the program using "niHSDIO Write Script.vi", and can be selected by hard-coding the 'script name' into "niHSDIO Configure Script To Generate.vi". It will successfully execute any of the scripts when hard-coded, but when trying to call the next script (script names stored in an array, and incremented with a while loop) an error is given:
    Error - 1074118651 occurred at niHSDIO Write
    Script.vi
    Possible reason(s):
    Driver Status: (Hex 0xBFFA4005) You cannot perform this
    action while the session is in the running state.
    At this point, I've read quite a bit online and in the documentation about trying to find a way to suspend, pause, etc. the state to allow another script to load, but I haven't been able to figure it out. 
    On the other hand, if there is a way to load a script of arbitary length, I believe that will resolve my problem as well. Please let me know what additional information may be needed to help solve this, as I'm sure I've left out all the good bits. 
    Thank you in advance, 
    Landon
    Edited for clarity. 

    Good morning Jonathan, 
    Thank you for your reply. I apologize for the delay in my response. Allow me to back up a little and give you some more information on the script. 
    The error is as follows: 
    Error - 1074116601 occurred at niHSDIO Write
    Script.vi
    Possible reason(s):
    Driver Status: (Hex 0xBFFA4807) Too many compiled
    instructions in loop. "Generate" and "Wait"
    instructions each result in at least one compiled
    instruction. Each marker adds an additional compiled
    instruction. Clear instruction does not result in a
    compiled instruction.
    If possible, reduce the number of generate instructions
    by concatenating the waveforms on two or more
    consecutive generate instructions.
    Line Number: 2
    Position in Line: 1
    Number of Instructions: 2048
    Maximum Number of Instructions: 55
    Status Code: -201016
    I have a waveform that is 524292 cycles long and I want to run 384 cycles, wait for an external trigger, run another 384 cycles beginning at a new position, wait for the same external trigger, and loop that 1024 times.  I thought scripting would work, but if there’s a better way please suggest it! I’m using a PXI-6551 with  64Mb/chan RAM in a PXIe 1062Q chassis with a PXIe-8370 controller cabled to a desktop Windows 7 box.
    As previously mentioned, the smaller scripts function correctly when split into sections of less than 55 lines. See below for an example functioning script. 
    Clear scriptTrigger0
    Generate mywfm subset(0,384)
    Wait until scriptTrigger0
    Clear scriptTrigger0
    Generate mywfm subset(512,384)
    Wait until scriptTrigger0
    Clear scriptTrigger0
    Generate mywfm subset(1024,384)
    Wait until scriptTrigger0
    Clear scriptTrigger0
    Generate mywfm subset(1536,384)
    Wait until scriptTrigger0
    Clear scriptTrigger0
    Generate mywfm subset(2048,384)
    Wait until scriptTrigger0
    Clear scriptTrigger0
    Generate mywfm subset(519168,384)
    Wait until scriptTrigger0
    Clear scriptTrigger0
    Generate mywfm subset(519680,384)
    However, when the full script (attached in text file) is entered, the error is generated. 
    Thank you again for your time. Please let me know any additional information you may need. 
    Landon 

  • WorkStation 11 shared VM's suddenly get a red X and "unable to read configuration data"

    This will usually follow a re-boot of the host machine, running Windows Server 2012.
    I can then REMOVE the machine(s)
    And open the .vmx file from the file manager ...
    After which I can again share the file.
    What can I do to prevent this?  Has anyone else seen the problem?
    Thanks!

    I'm seeing this as well. With Win7 as host OS. Not sure what causes it yet...
    Highly annoying!
    Update: Restarting "VMware Workstation Server" service seems to solve it. Tried setting the service to Automatic Start (Delayed), but that didn't help.
    Update2: For now I've implemented a script (based on http://csi-windows.com/toolkit/csi-vmwsautoshutdown) that restarts the service with some delay after system startup (Scheduled Task) and forcefully starts all VM's. This seems to help ensuring the VM's Auto-Start.
    VMwareHostdrestart.bat (call this from Scheduled Task)
    @echo off
    net stop VMwareHostd
    net start VMwareHostd
    %~dp0vmstartup.bat >%~dp0VMwareHostdrestart-vmstartup.log 2>&1
    vmstartup.bat (modify to contain credentials for an user with sufficient rights in VMware Workstation)
    @echo off
    set PROGROOT=%ProgramFiles%
    if not "%ProgramFiles(x86)%" == "" set PROGROOT=%ProgramFiles(x86)%
    set HOST=127.0.0.1
    set LOCALUSER=%COMPUTERNAME%\<username>
    set LOCALPWD=<userpass>
    set LOGGING=1
    if not exist "%PROGROOT%\VMware\VMware VIX\vmrun.exe" (
    echo VMware VIX Not Installed, aborting...
    if %LOGGING% EQU 1 (
    eventcreate /T ERROR /ID 1 /L APPLICATION /D "VMware VIX not installed, aborting..."
    goto :ALLDONE
    set VMRUN="%PROGROOT%\VMware\VMware VIX\vmrun.exe"
    rem start, stop, reset, suspend, pause, unpause
    set VMACTION=start
    setlocal EnableDelayedExpansion
    echo searching for vms...
    set STOPPEDVMCOUNT=0
    for /f "tokens=*" %%i in ('%VMRUN% -T ws-shared -h %HOST% -u %LOCALUSER% -p %LOCALPWD% listRegisteredVM ') do (
    echo %%i |findstr /I /C:"["
    if !ERRORLEVEL! EQU 0 (
    echo Processing %VMACTION% for VM: %%i
    %VMRUN% -T ws-shared -h %HOST% -u %LOCALUSER% -p %LOCALPWD% %VMACTION% "%%i"
    if %ERRORLEVEL% EQU 0 (
    if %LOGGING% EQU 1 (
    eventcreate /T INFORMATION /ID 1 /L APPLICATION /D "Successful %VMACTION% of VM: %%i"
    set /a STOPPEDVMCOUNT=!STOPPEDVMCOUNT!+1
    ) else (
    if %LOGGING% EQU 1 (
    eventcreate /T ERROR /ID 2 /L APPLICATION /D "Failed %VMACTION% of VM: %%i"
    echo %STOPPEDVMCOUNT% VMs Started
    rem if %LOGGING% EQU 1 (
    rem         eventcreate /T INFORMATION /ID 1000 /L APPLICATION /D "%STOPPEDVMCOUNT% VMs Started"
    rem )
    endlocal
    :ALLDONE
    REM pause

  • Weblogic 10.3 Not Removing Expired Messages from JMS Queues

    Dear All,
    We have an application that is running on Weblogic 10.3.
    This application (let us call this application Y) receives messages on a JMS queue. These messages are placed on the queue by another application (let us call this application X). We would like to have these messages expire within a certain amount of time (i.e. 90000 ms) if they are not consumed.
    Now when application X places the messages onto the queue for application Y to consume, the JMS producer sets the time to live to 90000 ms. We can see that expiration time has been set appropriately in the weblogic console. If a message sits on the queue for longer than 90000 ms the state string of the message is changed to "receive expired". What we don't understand is why the expired messages still end up being consumed from the queue.
    We understand that Weblogic is supposed to have an 'Active Message Expiration' thread that will remove expired messages from the queue. The Expiration Scan Interval for the JMS Server is set to 30 (seconds).
    Can anyone tell us why our expired messages don't seem to be deleted from the queues?
    Tim

    Thank you for the response Rene.
    We have set up both the active expiration scan and the message expiration policy. The active expiration scan is set for every 30 seconds. The message expiration policy is set to "discard". However, the expired messages are still being consumed. Is it possible we are doing something wrong? See a portion of our configuration files below.
    We have set up the expiration scan time interval. See a portion of our config.xml below:
    <jms-server>
    <name>brokerJMSServer</name>
    <target>AdminServer</target>
    <persistent-store xsi:nil="true"></persistent-store>
    <store-enabled>true</store-enabled>
    <allows-persistent-downgrade>false</allows-persistent-downgrade>
    <hosting-temporary-destinations>true</hosting-temporary-destinations>
    <temporary-template-resource xsi:nil="true"></temporary-template-resource>
    <temporary-template-name xsi:nil="true"></temporary-template-name>
    <message-buffer-size>-1</message-buffer-size>
    *<expiration-scan-interval>30</expiration-scan-interval>*
    <production-paused-at-startup>false</production-paused-at-startup>
    <insertion-paused-at-startup>false</insertion-paused-at-startup>
    <consumption-paused-at-startup>false</consumption-paused-at-startup>
    </jms-server>
    <jms-system-resource>
    <name>broker-jms</name>
    <target>AdminServer</target>
    <sub-deployment>
    <name>EhrBrokerRequestQueue</name>
    <target>brokerJMSServer</target>
    </sub-deployment>
    <descriptor-file-name>jms/broker-jms.xml</descriptor-file-name>
    </jms-system-resource>
    <admin-server-name>AdminServer</admin-server-name>
    We have set up the message expiration policy in our jms descriptor. See a portion below:
    <?xml version='1.0' encoding='UTF-8'?>
    <weblogic-jms xmlns="http://www.bea.com/ns/weblogic/weblogic-jms" xmlns:sec="http://www.bea.com/ns/weblogic/90/security" xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-jms http://www.bea.com/ns/weblogic/weblogic-jms/1.0/weblogic-jms.xsd">
    <queue name="EhrBrokerRequestQueue">
    <delivery-params-overrides>
    <redelivery-delay>-1</redelivery-delay>
    </delivery-params-overrides>
    <delivery-failure-params>
    <redelivery-limit>-1</redelivery-limit>
    *<expiration-policy>Discard</expiration-policy>*
    </delivery-failure-params>
    <jndi-name>EhrBrokerRequestQueue</jndi-name>
    </queue>
    </weblogic-jms>
    What could we be doing wrong?
    Kind Regards,
    Tim

  • Shell to.... no shell

    If I launch a prog like xmms in a shell, but then want to either keep working in that shell or close the shell, how do I put it in the .... background? ....
    Thanks.

    As cactus said, if you put an ampersand ( & ) at the end of the command you're running, it'll run in the background.
    If you've already run a program, but want to put it in the background, then focus the terminal you ran the program from, then type CTRL+Z (to suspend/"pause" the app) then on the command line, type:
    > bg
    >
    to start the app up again in the background.  The console output will look something like this if you run XMMS and use the CTRL+Z trick:
    $ xmms
    [1]+ Stopped xmms
    $ bg
    [1]+ xmms &
    $
    The line that says "Stopped" will appear after you hit CTRL+Z.

Maybe you are looking for