Apache ActiveMQ Artemis 提供簡單的 CDI 整合。它可以使用嵌入式代理程式或連接到遠端代理程式。
1. 設定連線
設定是透過實作 ArtemisClientConfiguration
介面來提供的。
public interface ArtemisClientConfiguration {
String getHost();
Integer getPort();
String getUsername();
String getPassword();
String getUrl();
String getConnectorFactory();
boolean startEmbeddedBroker();
boolean isHa();
boolean hasAuthentication();
}
如果未指定任何設定,則會提供預設的設定。這將會產生一個嵌入式代理程式。