Skip to content

Commit

Permalink
Fix data retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
carlesarnal committed Jan 18, 2024
1 parent 55ba002 commit ba67a56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ public class ConsumedCustomersResource {
@Transactional
@Blocking
public CompletionStage<Void> consume(Message<Envelope> customerMessage) {
final Value customer = customerMessage.getPayload().getAfter();
try {
final Value customer = customerMessage.getPayload().getBefore();

log.info(customerMessage.getPayload().toString());

log.info("Deleting customer with email: {}", customer.getEmail());
CustomerEntity customerEntity = new CustomerEntity();
customerEntity.setId((long) customer.getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.SequenceGenerator;

Expand All @@ -13,7 +14,7 @@
public class CustomerEntity extends PanacheEntityBase {

@Id
@GeneratedValue(generator = "customer_id_seq_generator")
@GeneratedValue(generator = "customer_id_seq_generator", strategy = GenerationType.SEQUENCE)
@SequenceGenerator(name = "customer_id_seq_generator", sequenceName = "customers_id_seq")
public Long id;

Expand Down

0 comments on commit ba67a56

Please sign in to comment.