Skip to content

Instantly share code, notes, and snippets.

@Test
public void testDropConsumerPendingAMQP() throws Throwable {
CountDownLatch latchCreating = new CountDownLatch(1);
CountDownLatch blockCreate = new CountDownLatch(1);
CountDownLatch done = new CountDownLatch(1);
ActiveMQServer server = createServer(true, createDefaultConfig(true));
server.start();
/*server.registerBrokerPlugin(new ActiveMQServerConsumerPlugin() {
@Override
public void afterCreateConsumer(ServerConsumer consumer) throws ActiveMQException {
@Test
public void testConsumerDroppedWithRegularClient() throws Exception {
int NUMBER_OF_CONNECTIONS = 100;
ActiveMQServer server = createServer(true, createDefaultConfig(true));
server.start();
Queue serverQueue = server.createQueue(new QueueConfiguration("test-queue").setRoutingType(RoutingType.ANYCAST)
.setAddress("test-queue")
.setAutoCreated(false));
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
*
def folder = new File(".")
def jars = folder.listFiles({ file -> file.isFile() && file.name.endsWith('.jar') })
def classpath = jars.collect { it.absolutePath }.join(':')
println "groovy -cp '" + classpath + "' XA.groovy"
import javax.jms.XAConnection;
import javax.jms.XASession;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
import org.apache.activemq.artemis.core.client.impl.ClientSessionImpl;
import org.apache.activemq.artemis.jms.client.ActiveMQConnection;
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
git clone https://github.com/apache/activemq-nms-amqp.git
cd activemq-nms-amqp
git checkout 1.8.x
git checkout 1.7.x
git checkout 2.0.x
git checkout main
cd ..
git clone https://github.com/rh-messaging/jira-git-report.git
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
import java.net.InetAddress;
import java.net.InetSocketAddress;
public class App
{
public static void main( String[] args )
{
if (args.length < 2) {
System.err.println("pass in host and port (number)");
System.exit(-1);