Skip to content

[Enhancement]: Ease the invocation of the Artemis CLI #11589

@snicoll

Description

@snicoll

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions