Skip to content

Commit 63dfc9d

Browse files
author
Igor Polevoy
committed
#261 Add ability to Async to move messages from one queue to another
1 parent 33564eb commit 63dfc9d

File tree

1 file changed

+16
-0
lines changed
  • javalite-async/src/main/java/org/javalite/async

1 file changed

+16
-0
lines changed

javalite-async/src/main/java/org/javalite/async/Async.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,22 @@ public int removeAllMessages(String queueName) {
531531
}
532532
}
533533

534+
/**
535+
* Moves all messages from one queue to another
536+
* @param source name of source queue
537+
* @param target name of target queue
538+
*
539+
* @return number of messages moved
540+
*/
541+
public int moveMessages(String source, String target){
542+
543+
try {
544+
return getQueueControl(source).moveMessages("", target);
545+
} catch (Exception e) {
546+
throw new AsyncException(e);
547+
}
548+
}
549+
534550

535551
/**
536552
* Get additional JMS configuration.

0 commit comments

Comments
 (0)