mirror of https://github.com/apache/activemq.git
Changes for https://issues.apache.org/jira/browse/AMQ-4165 : Remove pure master/slave functionality
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1414203 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
17b2b6c458
commit
1877a14a60
|
@ -33,7 +33,7 @@ import org.apache.activemq.store.jdbc.JDBCPersistenceAdapter;
|
||||||
import org.apache.activemq.util.IOHelper;
|
import org.apache.activemq.util.IOHelper;
|
||||||
import org.apache.derby.jdbc.EmbeddedDataSource;
|
import org.apache.derby.jdbc.EmbeddedDataSource;
|
||||||
|
|
||||||
public class JDBCQueueMasterSlaveTest extends QueueMasterSlaveTest {
|
public class JDBCQueueMasterSlaveTest extends QueueMasterSlaveTestSupport {
|
||||||
protected DataSource sharedDs;
|
protected DataSource sharedDs;
|
||||||
protected String MASTER_URL = "tcp://localhost:62001";
|
protected String MASTER_URL = "tcp://localhost:62001";
|
||||||
protected String SLAVE_URL = "tcp://localhost:62002";
|
protected String SLAVE_URL = "tcp://localhost:62002";
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
package org.apache.activemq.broker.ft;
|
package org.apache.activemq.broker.ft;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
import org.apache.activemq.ActiveMQConnectionFactory;
|
import org.apache.activemq.ActiveMQConnectionFactory;
|
||||||
|
@ -26,7 +25,7 @@ import org.apache.activemq.broker.TransportConnector;
|
||||||
import org.apache.activemq.store.amq.AMQPersistenceAdapter;
|
import org.apache.activemq.store.amq.AMQPersistenceAdapter;
|
||||||
|
|
||||||
|
|
||||||
public class QueueMasterSlaveSingleUrlTest extends QueueMasterSlaveTest {
|
public class QueueMasterSlaveSingleUrlTest extends QueueMasterSlaveTestSupport {
|
||||||
private final String brokerUrl = "tcp://localhost:62001";
|
private final String brokerUrl = "tcp://localhost:62001";
|
||||||
private final String singleUriString = "failover://(" + brokerUrl +")?randomize=false";
|
private final String singleUriString = "failover://(" + brokerUrl +")?randomize=false";
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,8 @@ import org.springframework.core.io.ClassPathResource;
|
||||||
/**
|
/**
|
||||||
* Test failover for Queues
|
* Test failover for Queues
|
||||||
*/
|
*/
|
||||||
public class QueueMasterSlaveTest extends JmsTopicSendReceiveWithTwoConnectionsTest {
|
abstract public class QueueMasterSlaveTestSupport extends JmsTopicSendReceiveWithTwoConnectionsTest {
|
||||||
private static final transient Logger LOG = LoggerFactory.getLogger(QueueMasterSlaveTest.class);
|
private static final transient Logger LOG = LoggerFactory.getLogger(QueueMasterSlaveTestSupport.class);
|
||||||
|
|
||||||
protected BrokerService master;
|
protected BrokerService master;
|
||||||
protected AtomicReference<BrokerService> slave = new AtomicReference<BrokerService>();
|
protected AtomicReference<BrokerService> slave = new AtomicReference<BrokerService>();
|
|
@ -17,7 +17,7 @@
|
||||||
package org.apache.activemq.broker.ft;
|
package org.apache.activemq.broker.ft;
|
||||||
|
|
||||||
public class QueueMasterSlaveTestUsingSharedFileTest extends
|
public class QueueMasterSlaveTestUsingSharedFileTest extends
|
||||||
QueueMasterSlaveTest {
|
QueueMasterSlaveTestSupport {
|
||||||
|
|
||||||
protected String getSlaveXml() {
|
protected String getSlaveXml() {
|
||||||
return "org/apache/activemq/broker/ft/sharedFileSlave.xml";
|
return "org/apache/activemq/broker/ft/sharedFileSlave.xml";
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
/**
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package org.apache.activemq.broker.ft;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Let's test composite destinations
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class QueueMasterSlaveUsingMasterConnectorElementCompositeQueueTest extends QueueMasterSlaveUsingMasterConnectorElementTest {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the consumer subject.
|
|
||||||
*
|
|
||||||
* @return String - consumer subject
|
|
||||||
* @see org.apache.activemq.test.TestSupport#getConsumerSubject()
|
|
||||||
*/
|
|
||||||
protected String getConsumerSubject() {
|
|
||||||
return "FOO.BAR.HUMBUG2";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the producer subject.
|
|
||||||
*
|
|
||||||
* @return String - producer subject
|
|
||||||
* @see org.apache.activemq.test.TestSupport#getProducerSubject()
|
|
||||||
*/
|
|
||||||
protected String getProducerSubject() {
|
|
||||||
return "queue://FOO.BAR.HUMBUG,queue://FOO.BAR.HUMBUG2";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
/**
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package org.apache.activemq.broker.ft;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Lets test using a <masterConnector/> element instead of the old masterConnectorURI attribute
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class QueueMasterSlaveUsingMasterConnectorElementTest extends QueueMasterSlaveTest {
|
|
||||||
|
|
||||||
protected String getSlaveXml() {
|
|
||||||
return "org/apache/activemq/broker/ft/slave2.xml";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
/**
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package org.apache.activemq.broker.ft;
|
|
||||||
|
|
||||||
import javax.jms.Connection;
|
|
||||||
import javax.jms.Destination;
|
|
||||||
import javax.jms.JMSException;
|
|
||||||
import javax.jms.MessageConsumer;
|
|
||||||
import javax.jms.Session;
|
|
||||||
import javax.jms.Topic;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test failover for Queues
|
|
||||||
*/
|
|
||||||
public class TopicMasterSlaveTest extends QueueMasterSlaveTest {
|
|
||||||
|
|
||||||
protected boolean isTopic() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected MessageConsumer createConsumer(Session session, Destination dest) throws JMSException {
|
|
||||||
return session.createDurableSubscriber((Topic)dest, "subName");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Connection createReceiveConnection() throws Exception {
|
|
||||||
Connection result = super.createReceiveConnection();
|
|
||||||
result.setClientID("clientId");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
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
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-->
|
|
||||||
<beans
|
|
||||||
xmlns="http://www.springframework.org/schema/beans"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
|
||||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
|
|
||||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
|
||||||
|
|
||||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
|
|
||||||
|
|
||||||
<broker brokerName="master" useJmx="false" deleteAllMessagesOnStartup="true" xmlns="http://activemq.apache.org/schema/core">
|
|
||||||
<transportConnectors>
|
|
||||||
<transportConnector uri="tcp://localhost:62001"/>
|
|
||||||
</transportConnectors>
|
|
||||||
|
|
||||||
</broker>
|
|
||||||
|
|
||||||
</beans>
|
|
|
@ -1,35 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
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
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-->
|
|
||||||
<beans
|
|
||||||
xmlns="http://www.springframework.org/schema/beans"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
|
||||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
|
|
||||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
|
||||||
|
|
||||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
|
|
||||||
|
|
||||||
<broker brokerName="slave" deleteAllMessagesOnStartup="true" useJmx="false" masterConnectorURI="tcp://localhost:62001" xmlns="http://activemq.apache.org/schema/core">
|
|
||||||
<transportConnectors>
|
|
||||||
<transportConnector uri="tcp://localhost:62002"/>
|
|
||||||
</transportConnectors>
|
|
||||||
|
|
||||||
|
|
||||||
</broker>
|
|
||||||
|
|
||||||
</beans>
|
|
|
@ -1,41 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
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
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-->
|
|
||||||
<beans
|
|
||||||
xmlns="http://www.springframework.org/schema/beans"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
|
||||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
|
|
||||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
|
||||||
|
|
||||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
|
|
||||||
|
|
||||||
<!-- START SNIPPET: example -->
|
|
||||||
<broker brokerName="slave" useJmx="false" deleteAllMessagesOnStartup="true" xmlns="http://activemq.apache.org/schema/core">
|
|
||||||
|
|
||||||
<services>
|
|
||||||
<masterConnector remoteURI= "tcp://localhost:62001" userName="James" password="Cheese"/>
|
|
||||||
</services>
|
|
||||||
|
|
||||||
<transportConnectors>
|
|
||||||
<transportConnector uri="tcp://localhost:62002"/>
|
|
||||||
</transportConnectors>
|
|
||||||
|
|
||||||
</broker>
|
|
||||||
<!-- END SNIPPET: example -->
|
|
||||||
|
|
||||||
</beans>
|
|
Loading…
Reference in New Issue