This repository has been archived by the owner on Apr 5, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XD-2719: Add Rabbit Bus Cleanup REST Method
JIRA: https://jira.spring.io/browse/XD-2719 curl 'http://localhost:9393/streams/clean/rabbit/foo\ ?user=guest&pw=guest&vhost=/&busPrefix=xdbus.&adminUri=http://localhost:15672' Query params are optional (defaults as shown). Looks for queues named xdbus.<stream>.0, 1, 2, 3 etc and possibly their associated .dlq companions. Verifies that none of the queues are currently in use (but does not check if they are empty. If no queues have consumers, all that were found are deleted. XD-2719: Remove Fanout Exchanges for Taps XD-2719: Clean Up Jobs Remove job queue event tap exchanges. curl -X DELETE localhost:9393/jobs/clean/rabbit/jobxxx
- Loading branch information
1 parent
61060d1
commit 2d5f3f7
Showing
32 changed files
with
965 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/integration/bus/BusCleaner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright 2015 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.springframework.xd.dirt.integration.bus; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
|
||
/** | ||
* Interface for implementations that perform cleanup for message buses. | ||
* | ||
* @author Gary Russell | ||
* @since 1.2 | ||
*/ | ||
public interface BusCleaner { | ||
|
||
/** | ||
* Clean up all resources for the supplied stream/job. | ||
* @param entity the stream or job. | ||
* @param isJob true if the entity is a job. | ||
* @return a map of lists of resources removed. | ||
*/ | ||
Map<String, List<String>> clean(String entity, boolean isJob); | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
...ain/java/org/springframework/xd/dirt/integration/bus/rabbit/NothingToDeleteException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2014 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.springframework.xd.dirt.integration.bus.rabbit; | ||
|
||
|
||
/** | ||
* Thrown when a delete operation has nothing to delete. | ||
* | ||
* @author Gary Russell | ||
* @since 1.2 | ||
*/ | ||
@SuppressWarnings("serial") | ||
public class NothingToDeleteException extends RabbitAdminException { | ||
|
||
public NothingToDeleteException(String message) { | ||
super(message); | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...rc/main/java/org/springframework/xd/dirt/integration/bus/rabbit/RabbitAdminException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright 2015 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.springframework.xd.dirt.integration.bus.rabbit; | ||
|
||
import org.springframework.xd.dirt.XDRuntimeException; | ||
|
||
|
||
/** | ||
* Exceptions thrown while interfacing with the RabbitMQ admin plugin. | ||
* | ||
* @author Gary Russell | ||
* @since 1.2 | ||
*/ | ||
@SuppressWarnings("serial") | ||
public class RabbitAdminException extends XDRuntimeException { | ||
|
||
public RabbitAdminException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
public RabbitAdminException(String message) { | ||
super(message); | ||
} | ||
|
||
} |
Oops, something went wrong.