Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/poc' into feature/poc
Browse files Browse the repository at this point in the history
  • Loading branch information
pasqualino.cristaudo committed Nov 23, 2023
2 parents 0a8872c + 9fa187a commit 7142a3f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.awspring.cloud.sqs.config.SqsBootstrapConfiguration;
import io.awspring.cloud.sqs.config.SqsMessageListenerContainerFactory;
import io.awspring.cloud.sqs.listener.acknowledgement.handler.AcknowledgementMode;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -35,6 +36,7 @@ public SqsMessageListenerContainerFactory<Object> defaultSqsListenerContainerFac
return SqsMessageListenerContainerFactory
.builder()
.configure(options -> options
.acknowledgementMode(AcknowledgementMode.ON_SUCCESS)
.maxConcurrentMessages(10)
.maxMessagesPerPoll(10))
.sqsAsyncClient(sqsAsyncClient())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
public interface SignalMapper {
String CORRELATION_ID_HEADER_KEY = "correlationId";

@Mapping(target = "indexSignal", source = "signal.signalId")
SignalEvent signalToSignalEvent(Signal signal);
@Mapping(target = "signalId", source = "signalEvent.indexSignal")

@Mapping(target = "correlationId", source = "correlationId")
Signal signalEventToSignal(SignalEvent signalEvent, String correlationId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ public class SignalEvent {

private String eserviceId;

private Long indexSignal;
private Long signalId;
}
59 changes: 30 additions & 29 deletions src/main/resources/db/changelog/changes/init_table/init_table.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CREATE TABLE IF NOT EXISTS ESERVICE (
eservice_id VARCHAR (50) NOT NULL,
producer_id VARCHAR (50) NOT NULL,
descriptor_id VARCHAR (50) NOT NULL,
eservice_id VARCHAR (255) NOT NULL,
producer_id VARCHAR (255) NOT NULL,
descriptor_id VARCHAR (255) NOT NULL,
event_id BIGINT,
state VARCHAR (50) NOT NULL,
state VARCHAR (255) NOT NULL,
tmst_insert TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
tmst_last_edit TIMESTAMP,
UNIQUE (eservice_id, producer_id, descriptor_id),
Expand All @@ -14,12 +14,12 @@ CREATE INDEX IF NOT EXISTS ESERVICE_INDEX_PRODUCER_ID ON ESERVICE USING hash (pr


CREATE TABLE IF NOT EXISTS CONSUMER_ESERVICE (
agreement_id VARCHAR (50) NOT NULL,
eservice_id VARCHAR (50) NOT NULL,
consumer_id VARCHAR (50) NOT NULL,
descriptor_id VARCHAR (50) NOT NULL,
agreement_id VARCHAR (255) NOT NULL,
eservice_id VARCHAR (255) NOT NULL,
consumer_id VARCHAR (255) NOT NULL,
descriptor_id VARCHAR (255) NOT NULL,
event_id BIGINT,
state VARCHAR (50) NOT NULL,
state VARCHAR (255) NOT NULL,
tmst_insert TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
tmst_last_edit TIMESTAMP,
UNIQUE (eservice_id, consumer_id, descriptor_id),
Expand All @@ -32,13 +32,13 @@ CREATE INDEX IF NOT EXISTS CONSUMER_ESERVICE_INDEX_DESCRIPTOR_ID ON CONSUMER_ESE

CREATE TABLE IF NOT EXISTS SIGNAL (
id SERIAL PRIMARY KEY,
correlation_id VARCHAR(50) NOT NULL,
correlation_id VARCHAR(255) NOT NULL,
signal_id BIGINT NOT NULL,
object_id VARCHAR (50) NOT NULL,
eservice_id VARCHAR (50) NOT NULL,
object_type VARCHAR (50) NOT NULL,
signal_type VARCHAR (50) NOT NULL,
tmst_insert TIMESTAMP NOT NULL,
object_id VARCHAR (255) NOT NULL,
eservice_id VARCHAR (255) NOT NULL,
object_type VARCHAR (255) NOT NULL,
signal_type VARCHAR (255) NOT NULL,
tmst_insert TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
UNIQUE (signal_id, eservice_id)
);
CREATE INDEX IF NOT EXISTS SIGNAL_INDEX_SIGNAL_ID ON SIGNAL USING hash (signal_id);
Expand All @@ -47,33 +47,34 @@ CREATE INDEX IF NOT EXISTS SIGNAL_INDEX_ESERVICE_ID ON SIGNAL USING hash (eservi

CREATE TABLE IF NOT EXISTS DEAD_SIGNAL (
id SERIAL PRIMARY KEY,
correlation_id VARCHAR(50) NOT NULL,
correlation_id VARCHAR(255) NOT NULL,
signal_id BIGINT NOT NULL,
object_id VARCHAR (50) NOT NULL,
eservice_id VARCHAR (50) NOT NULL,
object_type VARCHAR (50) NOT NULL,
signal_type VARCHAR (50) NOT NULL,
tmst_insert TIMESTAMP NOT NULL,
object_id VARCHAR (255) NOT NULL,
eservice_id VARCHAR (255) NOT NULL,
object_type VARCHAR (255) NOT NULL,
signal_type VARCHAR (255) NOT NULL,
tmst_insert TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
error_reason VARCHAR(255) NOT NULL
);


CREATE TABLE IF NOT EXISTS TRACING_BATCH (
batch_id SERIAL PRIMARY KEY,
state VARCHAR (50) NOT NULL,
state VARCHAR (255) NOT NULL,
type VARCHAR (50) NOT NULL,
last_event_id BIGINT,
tmst_created TIMESTAMP NOT NULL
tmst_created TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);


CREATE TABLE IF NOT EXISTS DEAD_EVENT (
event_tmp_id SERIAL PRIMARY KEY,
tmst_insert TIMESTAMP,
tmst_insert TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
error_reason VARCHAR(255) NOT NULL,
event_id BIGINT NOT NULL,
event_type VARCHAR (50) NOT NULL,
object_type VARCHAR (50) NOT NULL,
descriptor_id VARCHAR (50),
eservice_id VARCHAR (50),
agreement_id VARCHAR (50)
event_type VARCHAR (255) NOT NULL,
object_type VARCHAR (255) NOT NULL,
descriptor_id VARCHAR (255),
eservice_id VARCHAR (255),
agreement_id VARCHAR (255)
);

0 comments on commit 7142a3f

Please sign in to comment.