Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions administrator/version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Wed Sep 20 19:01:37 AEST 2023
VERSION_BUILD=781
#Wed Sep 20 23:33:32 AEST 2023
VERSION_BUILD=786
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,9 @@ public class AlignmentFIXEngineKafkaConsumer extends InterfaceKafkaAbstractSimpl

public AlignmentFIXEngineKafkaConsumer() throws Exception {
super();
// TODO Auto-generated constructor stub
}




/**
*
* @param kafkaConsumer
Expand All @@ -66,6 +63,12 @@ public KafkaConsumer<String, byte[]> getKafkaConsumer() {
return kafkaConsumer;
}

private synchronized void waiter() throws IllegalArgumentException, InterruptedException , IllegalMonitorStateException {
wait(2000);
}



@Override
public void run() {
AtomicBoolean run = new AtomicBoolean(true);
Expand All @@ -75,8 +78,8 @@ public void run() {

while (run.get()) {
try {
wait(2000);
} catch (InterruptedException e) {
waiter();
} catch (IllegalArgumentException | InterruptedException | IllegalMonitorStateException e) {
log.error(e.getMessage() , e );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,17 @@ protected void send(String topicName, String key, byte[] binaryMessage) {
this.kafkaProducerB.send(producerRecord);
}


private synchronized void waiter() throws IllegalArgumentException , InterruptedException , IllegalMonitorStateException {
wait(2000);
}

@Override
public void run() {
AtomicBoolean run = new AtomicBoolean(true);

while (run.get()) {
try {
wait(2000);
waiter();
} catch (IllegalArgumentException | InterruptedException | IllegalMonitorStateException e) {
log.error(e.getMessage() , e );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;

import org.apache.kafka.clients.admin.AdminClient;
import org.apache.kafka.clients.admin.KafkaAdminClient;
import org.apache.kafka.clients.admin.ListTopicsResult;

import com.alignmentsystems.fix44.MessageFactory;
import com.alignmentsystems.library.AlignmentFunctions;
import com.alignmentsystems.library.AlignmentLogEncapsulation;
Expand Down Expand Up @@ -140,6 +145,40 @@ private Boolean initialiseFIXMessagingInfrastructure(InstanceType instanceType)
AlignmentUEH ueh = new AlignmentUEH(debugger);
Thread.setDefaultUncaughtExceptionHandler(ueh);

//check - is Kafka running?
Properties props;
try {
props = AlignmentFunctions.getProperties(AlignmentInstanceWrapper.class.getClassLoader() , InstanceType.KAFKA.getProperties());
} catch (FileNotFoundException | NullPointerException e) {
log.error(e.getMessage(), e);
return false;
}

try (AdminClient client = KafkaAdminClient.create(props))
{
ListTopicsResult topics = client.listTopics();
Set<String> names = topics.names().get();
if (names.isEmpty())
{
// case: if no topic found.
log.error("No Topics Found");
return false;
}
}
catch (Exception e){
// Kafka is not available
log.error("Kafka is not available".toUpperCase());
log.error(e.getMessage() , e);
System.err.println(e.getMessage());
System.exit(FailureConditionConstants.KAFKA_NOT_RUNNING);
}








AlignmentQueueNonSequenced queueNonSequenced = new AlignmentQueueNonSequenced();
Thread threadQueueNonSequenced = new Thread(null, queueNonSequenced, AlignmentQueueNonSequenced.CLASSNAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,18 @@ public void runAlways(String topicName, InterfaceKafkaMessageHandler callback) t

}

private synchronized void waiter() throws IllegalArgumentException , InterruptedException , IllegalMonitorStateException {
wait(2000);
}


@Override
public void run() {
AtomicBoolean run = new AtomicBoolean(true);
while (run.get()) {
try {
wait(2000);
} catch (InterruptedException e) {
waiter();
} catch (IllegalArgumentException | InterruptedException | IllegalMonitorStateException e) {
log.error(e.getMessage() , e );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,17 @@ protected void send(String topicName, String key, byte[] binaryMessage) {
this.kafkaProducerB.send(producerRecord);
}


private synchronized void waiter() throws IllegalArgumentException , InterruptedException , IllegalMonitorStateException {
wait(2000);
}

@Override
public void run() {
AtomicBoolean run = new AtomicBoolean(true);
while (run.get()) {
while (run.get()) {
try {
wait(2000);
waiter();
} catch (IllegalArgumentException | InterruptedException | IllegalMonitorStateException e) {
log.error(e.getMessage() , e );
}
Expand Down
4 changes: 2 additions & 2 deletions exchange/version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Wed Sep 20 19:01:38 AEST 2023
VERSION_BUILD=779
#Wed Sep 20 23:33:32 AEST 2023
VERSION_BUILD=784
4 changes: 2 additions & 2 deletions fixclient/version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Wed Sep 20 19:01:38 AEST 2023
VERSION_BUILD=781
#Wed Sep 20 23:33:32 AEST 2023
VERSION_BUILD=786
4 changes: 2 additions & 2 deletions multicastserver/version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Wed Sep 20 19:01:38 AEST 2023
VERSION_BUILD=781
#Wed Sep 20 23:33:33 AEST 2023
VERSION_BUILD=786
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class FailureConditionConstants {

private final static int KAFKA_PROPERTIES_BASE_MEMBER = 3666;
public final static int KAFKA_ERROR_PROPERTIES_FILE = KAFKA_PROPERTIES_BASE_MEMBER + 1;
public final static int KAFKA_NOT_RUNNING = KAFKA_PROPERTIES_BASE_MEMBER + 2;

private final static int INSTANCE_WRAPPER_BASE_MEMBER = 4666;
public final static int INSTANCE_WRAPPER_INITIALISATION_ERROR = INSTANCE_WRAPPER_BASE_MEMBER + 1;
Expand Down

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions sharedlibrary/version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Wed Sep 20 19:01:38 AEST 2023
VERSION_BUILD=779
#Wed Sep 20 23:33:33 AEST 2023
VERSION_BUILD=784