Are scheduled messages are also shared when using activemq broker master-slave? I successfully created master-slave by jdbc, but the scheduled messages do not appear in the database. This makes the master-slave broker configuration not really a 100% failover system. Or is there anything I should specificly set up to make this happen?
With this code do I usually create the broker:
BrokerService brokerService = new BrokerService();
brokerService.setBrokerName(brokerName);
brokerService.addConnector("tcp://" + host + ":" + port);
brokerService.setSchedulerSupport(true);
// Allow JMX monitoring
brokerService.setUseJmx(true);
ManagementContext managementContext = new ManagementContext();
managementContext.setConnectorPort(port + 10000);
managementContext.setRmiServerPort(port + 20000);
brokerService.setManagementContext(managementContext);
// Set temp and store limits to 512MB to avoid
// unrealistic-limit-warnings
brokerService.getSystemUsage().getStoreUsage().setLimit(512 * 1024 * 1024);
brokerService.getSystemUsage().getTempUsage().setLimit(512 * 1024 * 1024);
And with this addition I create the master-slave datasource:
Map<String, Object> configuration = entityFactory.getProperties();
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName((String) configuration.get("hibernate.connection.driver_class"));
dataSource.setUrl((String) configuration.get("hibernate.connection.url"));
dataSource.setUsername((String) configuration.get("hibernate.connection.username"));
dataSource.setPassword((String) configuration.get("hibernate.connection.password"));
which I use to set the master-slave jbdcPersistenceAdapter:
JDBCPersistenceAdapter adapter = new JDBCPersistenceAdapter();
adapter.setDataSource(dataSource);
brokerService.setPersistenceAdapter(adapter);
which is followed by starting the brokerService:
brokerService.start();
This code all works fine. The queue is shared between brokers successfully, and the consumers do their job. The consumers sometimes create a producer which uses the failover-URL successfully to find out which broker is in the air. That all works well.
But, the scheduled messages do not appear in the database, and scheduled messages just stop appearing when the broker that has the scheduled message, is shut down.
Thanks!