We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have create the class to use the eventuate lib on application with spring and postgressql:
@Service @RequiredArgsConstructor public class AbstractMessageProducer { private final MessageProducer messageProducer; protected void send(final String eventType, final Object payload) { final Message message = MessageBuilder .withPayload(JSonMapper.toJson(payload)) .build(); messageProducer.send(eventType, message); } }
My table have the current DDL:
create table message ( id varchar(767) not null, incremental_id bigint default nextval('message_incremental_id_seq'::regclass) not null, destination varchar(1000) not null, headers text not null, payload text not null, published smallint default 0, message_partition smallint, creation_time bigint not null, primary key (id, creation_time) ) partition by RANGE (creation_time);
To validate if the AbstractMessageProducer works fine I have create this integration test:
@InfrastructureIntegrationTest class AbstractMessageProducerIT { @Autowired private EntityManager entityManager; @Qualifier("abstractMessageProducer") @Autowired private AbstractMessageProducer abstractMessageProducer; @Test void shouldAddOnMessageTableTheEvent() { final var payload = UpsertPropertyDTO.builder() .eventType("UPDATE_PROPERTY") .payload(UpsertExternalHouseDTO.builder().build()) .build(); abstractMessageProducer.send(payload.getEventType(), payload.getPayload()); final var result = entityManager .createNativeQuery("SELECT * FROM message", String.class) .getResultList(); assertEquals(1, result.size()); } }
My integration test use test-container DB to run this test and apply the migration on db with flyway. But this test failed with error:
PreparedStatementCallback; SQL [insert into message(id, destination, headers, payload, creation_time, published, message_partition) values(?, ?, ?, ?, null, ?, ?)]; ERROR: no partition of relation "message" found for row Detalhe: Partition key of the failing row contains (creation_time) = (null). org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [insert into message(id, destination, headers, payload, creation_time, published, message_partition) values(?, ?, ?, ?, null, ?, ?)]; ERROR: no partition of relation "message" found for row
Where eventuate lib not set value for creation_time. Do you guys know what happens here?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have create the class to use the eventuate lib on application with spring and postgressql:
My table have the current DDL:
To validate if the AbstractMessageProducer works fine I have create this integration test:
My integration test use test-container DB to run this test and apply the migration on db with flyway. But this test failed with error:
Where eventuate lib not set value for creation_time. Do you guys know what happens here?
The text was updated successfully, but these errors were encountered: