@@ -538,7 +538,7 @@ func (r *Reader) readOutboxMessages() ([]*Message, error) {
538538 defer cancel ()
539539
540540 // nolint:gosec
541- query := r .buildSelectMessagesQuery ()
541+ query := r .dbCtx . buildSelectMessagesQuery ()
542542 rows , err := r .dbCtx .db .QueryContext (ctx , query , r .maxMessages )
543543 if err != nil {
544544 return nil , fmt .Errorf ("failed to query outbox messages: %w" , err )
@@ -560,27 +560,3 @@ func (r *Reader) readOutboxMessages() ([]*Message, error) {
560560 }
561561 return messages , nil
562562}
563-
564- func (r * Reader ) buildSelectMessagesQuery () string {
565- limitPlaceholder := r .dbCtx .getSQLPlaceholder (1 )
566-
567- switch r .dbCtx .dialect {
568- case SQLDialectOracle :
569- return fmt .Sprintf (`SELECT id, payload, created_at, scheduled_at, metadata, times_attempted
570- FROM outbox
571- WHERE scheduled_at <= %s
572- ORDER BY created_at ASC FETCH FIRST %s ROWS ONLY` , r .dbCtx .getCurrentTimestampInUTC (), limitPlaceholder )
573-
574- case SQLDialectSQLServer :
575- return fmt .Sprintf (`SELECT TOP (%s) id, payload, created_at, scheduled_at, metadata, times_attempted
576- FROM outbox
577- WHERE scheduled_at <= %s
578- ORDER BY created_at ASC` , limitPlaceholder , r .dbCtx .getCurrentTimestampInUTC ())
579-
580- default :
581- return fmt .Sprintf (`SELECT id, payload, created_at, scheduled_at, metadata, times_attempted
582- FROM outbox
583- WHERE scheduled_at <= %s
584- ORDER BY created_at ASC LIMIT %s` , r .dbCtx .getCurrentTimestampInUTC (), limitPlaceholder )
585- }
586- }
0 commit comments