@Test public void shouldProvisionPartitionedProducerWithRequiredGroups() { String partitionedAddress0 = String.format("%s-0", address); String partitionedAddress1 = String.format("%s-1", address); given(mockProducerProperties.getRequiredGroups()).willReturn(groups); given(mockProducerProperties.isPartitioned()).willReturn(true); given(mockProducerProperties.getPartitionCount()).willReturn(2); ProducerDestination destination = provider.provisionProducerDestination(address, mockProducerProperties); assertThat(destination).isInstanceOf(ArtemisProducerDestination.class); assertThat(destination.getNameForPartition(0)).isEqualTo(partitionedAddress0); assertThat(destination.getNameForPartition(1)).isEqualTo(partitionedAddress1); verify(mockArtemisBrokerManager).createAddress(partitionedAddress0, mockArtemisProducerProperties); verify(mockArtemisBrokerManager).createAddress(partitionedAddress1, mockArtemisProducerProperties); verify(mockArtemisBrokerManager).createQueue(partitionedAddress0, getQueueName(partitionedAddress0, groups[0])); verify(mockArtemisBrokerManager).createQueue(partitionedAddress0, getQueueName(partitionedAddress0, groups[1])); verify(mockArtemisBrokerManager).createQueue(partitionedAddress1, getQueueName(partitionedAddress1, groups[0])); verify(mockArtemisBrokerManager).createQueue(partitionedAddress1, getQueueName(partitionedAddress1, groups[1])); }
@Override public ProducerDestination provisionProducerDestination(String address, ExtendedProducerProperties<ArtemisProducerProperties> properties) throws ProvisioningException { if (properties.isPartitioned()) { return provisionPartitionedProducerDestination(address, properties); } return provisionUnpartitionedProducerDestination(address, properties); }
ArtemisProvisioningProvider implements ProvisioningProvider<
        ExtendedConsumerProperties<ArtemisConsumerProperties>, ExtendedProducerProperties<ArtemisProducerProperties>> { @Override public ProducerDestination provisionProducerDestination(String address, ExtendedProducerProperties<ArtemisProducerProperties> properties) throws ProvisioningException { if (properties.isPartitioned()) { return provisionPartitionedProducerDestination(address, properties); } return provisionUnpartitionedProducerDestination(address, properties); } }
ArtemisProvisioningProvider implements ProvisioningProvider<
        ExtendedConsumerProperties<ArtemisConsumerProperties>, ExtendedProducerProperties<ArtemisProducerProperties>> { @Override public ProducerDestination provisionProducerDestination(String address, ExtendedProducerProperties<ArtemisProducerProperties> properties) throws ProvisioningException { if (properties.isPartitioned()) { return provisionPartitionedProducerDestination(address, properties); } return provisionUnpartitionedProducerDestination(address, properties); } ArtemisProvisioningProvider(ArtemisBrokerManager artemisBrokerManager); }
ArtemisProvisioningProvider implements ProvisioningProvider<
        ExtendedConsumerProperties<ArtemisConsumerProperties>, ExtendedProducerProperties<ArtemisProducerProperties>> { @Override public ProducerDestination provisionProducerDestination(String address, ExtendedProducerProperties<ArtemisProducerProperties> properties) throws ProvisioningException { if (properties.isPartitioned()) { return provisionPartitionedProducerDestination(address, properties); } return provisionUnpartitionedProducerDestination(address, properties); } ArtemisProvisioningProvider(ArtemisBrokerManager artemisBrokerManager); @Override ProducerDestination provisionProducerDestination(String address,
            ExtendedProducerProperties<ArtemisProducerProperties> properties); @Override ConsumerDestination provisionConsumerDestination(String address, String group,
            ExtendedConsumerProperties<ArtemisConsumerProperties> properties); }
ArtemisProvisioningProvider implements ProvisioningProvider<
        ExtendedConsumerProperties<ArtemisConsumerProperties>, ExtendedProducerProperties<ArtemisProducerProperties>> { @Override public ProducerDestination provisionProducerDestination(String address, ExtendedProducerProperties<ArtemisProducerProperties> properties) throws ProvisioningException { if (properties.isPartitioned()) { return provisionPartitionedProducerDestination(address, properties); } return provisionUnpartitionedProducerDestination(address, properties); } ArtemisProvisioningProvider(ArtemisBrokerManager artemisBrokerManager); @Override ProducerDestination provisionProducerDestination(String address,
            ExtendedProducerProperties<ArtemisProducerProperties> properties); @Override ConsumerDestination provisionConsumerDestination(String address, String group,
            ExtendedConsumerProperties<ArtemisConsumerProperties> properties);  }