У меня есть Jetty, который запускает встроенный брокер ActiveMQ.Я пытаюсь подключиться к нему с помощью JMSToolBox, но получаю следующее исключение:
Transport Connection to: tcp://127.0.0.1:44523 failed: java.io.IOException: Unknown data type: 97
Мой код выглядит следующим образом:
File dataFileDir = new File("target/amq-in-action/kahadb");
KahaDBStore kaha = new KahaDBStore();
kaha.setDirectory(dataFileDir);
kaha.setJournalMaxFileLength(1024 * 1204 * 100);
kaha.setIndexWriteBatchSize(100);
kaha.setEnableIndexWriteAsync(false);
List<AuthenticationUser> users = new ArrayList<AuthenticationUser>();
users.add(new AuthenticationUser(USER_NAME, PWD, "users,users_write"));
SimpleAuthenticationPlugin simpleAuthenticationPlugin = new SimpleAuthenticationPlugin(users);
simpleAuthenticationPlugin.setAnonymousAccessAllowed(false);
List<DestinationMapEntry> authorizationEntries = new ArrayList<>();
// giving permission to read the queue for users groups
AuthorizationEntry authorizationEntry = new AuthorizationEntry();
authorizationEntry.setRead("users");
authorizationEntry.setWrite("admins,users_write");
authorizationEntry.setAdmin("admins");
authorizationEntry.setQueue("Provisioning");
authorizationEntries.add(authorizationEntry);
// "Note that full access rights should generally be given to the ActiveMQ.Advisory destinations because by default an ActiveMQConnection uses destination advisors to get early knowledge of temp destination creation and deletion." -> http://activemq.apache.org/security.html
authorizationEntry = new AuthorizationEntry();
authorizationEntry.setRead("guests,users");
authorizationEntry.setWrite("guests,users");
authorizationEntry.setAdmin("guests,users");
authorizationEntry.setTopic("ActiveMQ.Advisory.>");
authorizationEntries.add(authorizationEntry);
AuthorizationMap authorizationMap = new DefaultAuthorizationMap(authorizationEntries);
AuthorizationPlugin authorizationPlugin = new AuthorizationPlugin(authorizationMap);
// creating the broker service
broker = new BrokerService();
broker.setPersistenceAdapter(kaha);
broker.setUseJmx(false);
broker.setPlugins(new BrokerPlugin[]{simpleAuthenticationPlugin, authorizationPlugin});
broker.addConnector("tcp://localhost:61616");
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost");
new Resource(null, "java:/ConnectionFactory", connectionFactory);
broker.start();
Я предполагаю, что я смогу подключитьсяво встроенную очередь из внешнего инструмента.
Есть идеи?
Спасибо,
V.