No announcement yet.

Stopping source connector from chanel

  • Filter
  • Time
  • Show
Clear All
new posts

  • Stopping source connector from chanel


    I am working with Mirth Connect for mapping DICOM objects between systems with a lot of mesages and I would like to stop source connector when the length of the queue is biger than one number (i.e. 5000 messages) and restart it when the queue is smaller than 2000.

    Is it posible to do this?

    I have seen that is posible to stop the channel, but not how to stop/pause the source or destination in a channel.
    From the GUI this is posible but I would like to do it from java/javascript.

    Thanks a lot!
    Be regards!

  • #2
    Here is some code but it needs testing but could be a idear or a start.

    !!!! CODE NOT TESTED !!!!

    function QueueControl(cid){
    var channelStatisticsController = nelStatisticsController.getInstance();
    var channelStatusController = nelStatusController.getInstance();
    var stats = channelStatisticsController.getStatistics(cid);
    var state = channelStatusController.getState(cid);

    //IF Queue is bigger than X
    if(stats.queued > 5000) channelStatusController.pauseChannel(cid);
    If (state = paused) {
    if(status.queud < 2000) channelStatusController.resumeChannel(cid);


    This works on the hole channel but not on a destination.
    Can some one help here.


    • #3
      FYI in 3.x you should be using ChannelUtil.
      Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

      Nicholas Rupley
      Work: 949-237-6069
      Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.

      - How do I foo?
      - You just bar.