Commit 08ada002 authored by Shrikant Garg's avatar Shrikant Garg
Browse files

Merge branch 'configurable_topic_name' into 'master'

topic name made configurable

See merge request !32
parents 98bf09bf fe10e9b0
Pipeline #70779 failed with stages
in 8 minutes and 55 seconds
......@@ -18,6 +18,7 @@ import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.core.common.model.status.Message;
import org.opengroup.osdu.core.common.status.IEventPublisher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jms.JmsException;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;
......@@ -27,8 +28,11 @@ import com.google.gson.Gson;
@Component
public class StatusEventPublisher implements IEventPublisher {
@Value("${status.update.event.topic:status-event-default-topic}")
private String STATUS_UPDATE_EVENT_TOPIC;
private static final String FAILED_TO_PUBLISH_STATUS = "Failed to publish status. ";
private final static String RECORDS_CHANGED_TOPIC="records-changed-topic";
String correlationId = null;
String dataPartitionId = null;
private Set<String> existingTopics = new HashSet<String>();
......@@ -46,7 +50,7 @@ public class StatusEventPublisher implements IEventPublisher {
log.info(DpsHeaders.CORRELATION_ID + " " + correlationId + DpsHeaders.DATA_PARTITION_ID + " " + dataPartitionId
+ " status msgs: " + messages);
String topicNameWithPrefix = dataPartitionId + "-" + RECORDS_CHANGED_TOPIC;
String topicNameWithPrefix = dataPartitionId + "-" + STATUS_UPDATE_EVENT_TOPIC;
String msg = "";
if (existingTopics.contains(topicNameWithPrefix)) {
for(Message message:messages) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment