Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
*
* @author Gary Russell
* @author Thomas Strauß
* @author Kwon YongHyun
*/
public interface ProducerFactory<K, V> {

Expand All @@ -43,6 +44,11 @@ public interface ProducerFactory<K, V> {
*/
Duration DEFAULT_PHYSICAL_CLOSE_TIMEOUT = Duration.ofSeconds(30);

/**
* Error message for unsupported factory methods.
*/
String FACTORY_DOES_NOT_SUPPORT_METHOD = "This factory does not support this method";

/**
* Create a producer which will be transactional if the factory is so configured.
* @return the producer.
Expand All @@ -57,7 +63,7 @@ public interface ProducerFactory<K, V> {
* @since 2.3
*/
default Producer<K, V> createProducer(@Nullable @SuppressWarnings("unused") String txIdPrefix) {
throw new UnsupportedOperationException("This factory does not support this method");
throw new UnsupportedOperationException(FACTORY_DOES_NOT_SUPPORT_METHOD);
}

/**
Expand All @@ -67,7 +73,7 @@ default Producer<K, V> createProducer(@Nullable @SuppressWarnings("unused") Stri
* @see #transactionCapable()
*/
default Producer<K, V> createNonTransactionalProducer() {
throw new UnsupportedOperationException("This factory does not support this method");
throw new UnsupportedOperationException(FACTORY_DOES_NOT_SUPPORT_METHOD);
}

/**
Expand Down