Skip to content

Commit

Permalink
Merge pull request #22 from telekom/feature-new-mongo-query-to-fix-pr…
Browse files Browse the repository at this point in the history
…ocessed-msg

Feature new mongo query to fix processed msg
  • Loading branch information
ledex committed Apr 18, 2024
2 parents 80ae2d9 + 6ddcf87 commit c858caf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,13 @@ public interface MessageStateMongoRepo extends MongoRepository<MessageStateMongo
Slice<MessageStateMongoDocument> findByDeliveryTypeAndStatusAndModifiedLessThanEqual(DeliveryType deliveryType, Status status, Date upperTimestampThreshold);
Slice<MessageStateMongoDocument> findByDeliveryTypeAndStatusAndModifiedLessThanEqual(DeliveryType deliveryType, Status status, Date upperTimestampThreshold, Pageable pageable);


@Query(value = "{ \"error.type\": \"de.telekom.horizon.dude.exception.CallbackUrlNotFoundException\" , \"status\": { \"$eq\": \"FAILED\" } }", sort = "{timestamp: 1}")
Slice<MessageStateMongoDocument> findStatusFailedWithCallbackExceptionAsc();
@Query(value = "{ \"error.type\": \"de.telekom.horizon.dude.exception.CallbackUrlNotFoundException\" , \"status\": { \"$eq\": \"FAILED\" } }", sort = "{timestamp: 1}")
Slice<MessageStateMongoDocument> findStatusFailedWithCallbackExceptionAsc(Pageable pageable);


@Query(value = "{status: {$in: ?0}, deliveryType: ?1, subscriptionId: ?2}", sort = "{timestamp: 1}")
List<MessageStateMongoDocument> findByStatusInAndDeliveryTypeAndSubscriptionIdAsc(List<Status> status, DeliveryType deliveryType, String subscriptionId);

@Query(value = "{status: {$in: ?0}, deliveryType: ?1, subscriptionId: ?2}", sort = "{timestamp: 1}")
Slice<MessageStateMongoDocument> findByStatusInAndDeliveryTypeAndSubscriptionIdAsc(List<Status> status, DeliveryType deliveryType, String subscriptionId, Pageable pageable);

Expand All @@ -57,6 +54,8 @@ public interface MessageStateMongoRepo extends MongoRepository<MessageStateMongo
@Query(value = "{$or:[{\"error.type\":{ $exists: false}},{\"error.type\":\"de.telekom.horizon.dude.exception.CallbackUrlNotFoundException\"}], status:{ $in: ?0 }, subscriptionId:{ $in: ?1 }, modified: { $lte: ?2 } }", sort = "{timestamp: 1}")
Slice<MessageStateMongoDocument> findByStatusInPlusCallbackUrlNotFoundExceptionAsc(List<Status> status, List<String> subscriptionIds, Date timestampOlderThan, Pageable pageable);

@Query(value = "{$or:[{\"status\":{ $eq: \"WAITING\"}},{\"error.type\":\"de.telekom.horizon.dude.exception.CallbackUrlNotFoundException\"}], status:{ $in: ?0 }, subscriptionId:{ $in: ?1 }, modified: { $lte: ?2 }}", sort = "{timestamp: 1}")
Slice<MessageStateMongoDocument> findByStatusWaitingOrWithCallbackExceptionAndSubscriptionIdsAndTimestampLessThanEqual(List<Status> status, List<String> subscriptionIds, Date upperTimestampThreshold, Pageable pageable);

List<MessageStateMongoDocument> findByMultiplexedFrom(String multiplexedFromId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static void setProperties(DynamicPropertyRegistry registry) {

@BeforeAll
static void initContainer() {
// mongoDBContainer.start();
//mongoDBContainer.start();

testPartition = 123;
testDeliveryType = DeliveryType.CALLBACK;
Expand Down

0 comments on commit c858caf

Please sign in to comment.