testcontainers / testcontainers/testcontainers-java
[Enhancement]: Ease the invocation of the Artemis CLI
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 1.9k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 9
Description
Module
ActiveMQ
Proposal
An ArtemisContainer is bundled with the Artemis CLI that lets you administer the broker.
Here is an example of how you can create a queue (useful when testing against AMQP 1.0 as the queue isn't created automatically):
private void createQueue(String name) {
try {
ExecResult execResult = container.execInContainer("/var/lib/artemis-instance/bin/artemis", "queue",
"create", "--name=" + name, "--auto-create-address", "--anycast", "--silent",
"--user=" + container.getUser(), "--password=" + container.getPassword());
if (execResult.getExitCode() != 0) {
throw new IllegalStateException("Failed to create queue: " + execResult.getStderr());
}
}
catch (Exception ex) {
throw new IllegalStateException("Failed to create queue " + name, ex);
}
}
I wonder about /var/lib/artemis-instance/bin/artemis and the --user and --password element. It'd certainly be nice if we could have a bit of syntaxic sugar where you could "just" invoke the artemis command without having to deal with this. It'd also be a nice way to promote that feature in the API.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ArtemisContainer and its current execInContainer usage, then review the linked Artemis CLI documentation and the example command in this issue. The change is complete when callers can invoke the bundled Artemis CLI without supplying its container path or manually passing the container credentials.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java
- Domain
- cli, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100