forked from confluentinc/demo-scene
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor to start supporting non-monolith runtime
- Loading branch information
Neil Avery
committed
Apr 11, 2019
1 parent
07fe8dd
commit 0b80e62
Showing
11 changed files
with
103 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
scalable-payment-processing/src/main/java/io/confluent/kpay/control/ControlProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package io.confluent.kpay.control; | ||
|
||
import io.confluent.kpay.control.model.Status; | ||
import io.confluent.kpay.util.KafkaTopicClient; | ||
import java.util.Properties; | ||
import org.apache.kafka.common.serialization.Serdes; | ||
|
||
import static io.confluent.kpay.util.PropertiesGetter.getProperties; | ||
|
||
public class ControlProperties { | ||
final public static String controlStatusTopic = "kpay.control.status"; | ||
final static int partitionCount = 5; | ||
final static short replicaCount = 1; | ||
|
||
|
||
public static Properties get(String broker) { | ||
return getProperties(broker, Serdes.String().getClass().getName(), Status.Serde.class.getName()); | ||
} | ||
|
||
public static void initializeEnvironment(KafkaTopicClient topicClient) { | ||
topicClient.createTopic(controlStatusTopic, partitionCount, replicaCount); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
scalable-payment-processing/src/main/java/io/confluent/kpay/payments/PaymentProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package io.confluent.kpay.payments; | ||
|
||
import io.confluent.kpay.payments.model.Payment; | ||
import io.confluent.kpay.util.KafkaTopicClient; | ||
import io.confluent.kpay.util.PropertiesGetter; | ||
import java.util.Properties; | ||
import org.apache.kafka.common.serialization.Serdes; | ||
import org.apache.kafka.streams.StreamsConfig; | ||
|
||
public class PaymentProperties { | ||
final static int partitionCount = 5; | ||
final static short replicaCount = 1; | ||
|
||
final static public String paymentsIncomingTopic = "kpay.payments.incoming"; | ||
final static public String paymentsInflightTopic = "kpay.payments.inflight"; | ||
final static public String paymentsCompleteTopic = "kpay.payments.complete"; | ||
final static public String paymentsConfirmedTopic = "kpay.payments.confirmed"; | ||
|
||
|
||
public static Properties get(String broker, int portOffset) { | ||
Properties properties = PropertiesGetter.getProperties(broker, Serdes.String().getClass().getName(), Payment.Serde.class.getName()); | ||
// payment processors startProcessors from 20000 | ||
properties.put(StreamsConfig.APPLICATION_SERVER_CONFIG, PropertiesGetter.getIpAddress() + ":" + portOffset); | ||
System.out.println(" APP PORT:" + properties.get(StreamsConfig.APPLICATION_SERVER_CONFIG)); | ||
return properties; | ||
} | ||
|
||
public static void initializeEnvironment(KafkaTopicClient topicClient) { | ||
topicClient.createTopic(PaymentProperties.paymentsInflightTopic, partitionCount, replicaCount); | ||
topicClient.createTopic(PaymentProperties.paymentsIncomingTopic, partitionCount, replicaCount); | ||
topicClient.createTopic(PaymentProperties.paymentsCompleteTopic, partitionCount, replicaCount); | ||
topicClient.createTopic(PaymentProperties.paymentsConfirmedTopic, partitionCount, replicaCount); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.