-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from Microarchitecturovisco/RSWW-81-Book-trans…
…ports-saga ReadyForReview: RSWW-81 Checking transport availability - saga
- Loading branch information
Showing
23 changed files
with
204 additions
and
108 deletions.
There are no files selected for viewing
3 changes: 0 additions & 3 deletions
3
...ain/java/org/microarchitecturovisco/hotelservice/controllers/HotelsCommandController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 4 additions & 10 deletions
14
...onservice/queues/config/QueuesConfig.java → ...vice/queues/config/QueuesHotelConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,27 @@ | ||
package org.microarchitecturovisco.reservationservice.queues.config; | ||
|
||
import org.springframework.amqp.core.*; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class QueuesConfig { | ||
public class QueuesHotelConfig { | ||
|
||
public static final String EXCHANGE_HOTEL = "hotels.requests.checkAvailabilityByQuery.exchange"; | ||
public static final String QUEUE_HOTEL_BOOK_REQ = "hotels.requests.checkAvailabilityByQuery.queue"; | ||
public static final String ROUTING_KEY_HOTEL_BOOK_REQ = "hotels.requests.checkAvailabilityByQuery.routingKey"; | ||
|
||
public static final String EXCHANGE_TRANSPORT = "transports.requests.checkAvailabilityByQuery.exchange"; | ||
public static final String QUEUE_TRANSPORT_BOOK_REQ = "transports.requests.checkAvailabilityByQuery.queue"; | ||
public static final String ROUTING_KEY_TRANSPORT_BOOK_REQ = "transports.requests.checkAvailabilityByQuery.routingKey"; | ||
|
||
|
||
@Bean | ||
@Bean(name="handleReservationExchange") | ||
public TopicExchange handleReservationExchange() { | ||
return new TopicExchange(EXCHANGE_HOTEL); | ||
} | ||
|
||
|
||
@Bean | ||
public Queue handleReservationQueue() { | ||
return new Queue(QUEUE_HOTEL_BOOK_REQ); | ||
} | ||
@Bean | ||
public Binding handleReservationRequestBinding(TopicExchange handleReservationExchange, Queue handleReservationQueue) { | ||
public Binding handleReservationRequestBinding(@Qualifier("handleReservationExchange") TopicExchange handleReservationExchange, Queue handleReservationQueue) { | ||
return BindingBuilder.bind(handleReservationQueue).to(handleReservationExchange).with(ROUTING_KEY_HOTEL_BOOK_REQ); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...va/org/microarchitecturovisco/reservationservice/queues/config/QueuesTransportConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.microarchitecturovisco.reservationservice.queues.config; | ||
|
||
import org.springframework.amqp.core.Binding; | ||
import org.springframework.amqp.core.BindingBuilder; | ||
import org.springframework.amqp.core.Queue; | ||
import org.springframework.amqp.core.TopicExchange; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class QueuesTransportConfig { | ||
|
||
public static final String EXCHANGE_TRANSPORT = "transports.requests.checkAvailabilityByQuery.exchange"; | ||
public static final String QUEUE_TRANSPORT_BOOK_REQ = "transports.requests.checkAvailabilityByQuery.queue"; | ||
public static final String ROUTING_KEY_TRANSPORT_BOOK_REQ = "transports.requests.checkAvailabilityByQuery.routingKey"; | ||
|
||
|
||
@Bean(name="handleTransportReservationExchange") | ||
public TopicExchange handleTransportReservationExchange() { | ||
return new TopicExchange(EXCHANGE_TRANSPORT); | ||
} | ||
@Bean | ||
public Queue handleTransportReservationQueue() { | ||
return new Queue(QUEUE_TRANSPORT_BOOK_REQ); | ||
} | ||
@Bean | ||
public Binding handleTransportReservationRequestBinding(@Qualifier("handleTransportReservationExchange") TopicExchange handleTransportReservationExchange, Queue handleTransportReservationQueue) { | ||
return BindingBuilder.bind(handleTransportReservationQueue).to(handleTransportReservationExchange).with(ROUTING_KEY_TRANSPORT_BOOK_REQ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
...java/org/microarchitecturovisco/reservationservice/queues/hotels/ReservationResponse.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...chitecturovisco/transport/controllers/reservations/CheckTransportAvailabilityRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.microarchitecturovisco.transport.controllers.reservations; | ||
|
||
import lombok.*; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
@Builder | ||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@ToString | ||
public class CheckTransportAvailabilityRequest { | ||
private LocalDateTime hotelTimeFrom; | ||
|
||
private LocalDateTime hotelTimeTo; | ||
|
||
private int adultsQuantity; | ||
|
||
private int childrenUnder3Quantity; | ||
|
||
private int childrenUnder10Quantity; | ||
|
||
private int childrenUnder18Quantity; | ||
|
||
private List<UUID> departureLocationIdsByPlane; | ||
private List<UUID> departureLocationIdsByBus; | ||
private List<UUID> arrivalLocationIds; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...port/rabbitmq/config/ExchangesConfig.java → ...nsport/queues/config/ExchangesConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...ervice/src/main/java/org/microarchitecturovisco/transport/queues/config/QueuesConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.microarchitecturovisco.transport.queues.config; | ||
|
||
import org.springframework.amqp.core.Binding; | ||
import org.springframework.amqp.core.BindingBuilder; | ||
import org.springframework.amqp.core.Queue; | ||
import org.springframework.amqp.core.TopicExchange; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class QueuesConfig { | ||
|
||
public static final String EXCHANGE_TRANSPORT = "transports.requests.checkAvailabilityByQuery.exchange"; | ||
public static final String QUEUE_TRANSPORT_BOOK_REQ = "transports.requests.checkAvailabilityByQuery.queue"; | ||
|
||
@Bean | ||
public Queue handleReservationQueue() { | ||
return new Queue(QUEUE_TRANSPORT_BOOK_REQ, false); | ||
} | ||
|
||
@Bean | ||
public TopicExchange handleReservationExchange() { | ||
return new TopicExchange(EXCHANGE_TRANSPORT); | ||
} | ||
|
||
@Bean | ||
public Binding handleReservationRequestBinding(TopicExchange handleReservationExchange, Queue handleReservationQueue) { | ||
return BindingBuilder.bind(handleReservationQueue).to(handleReservationExchange).with(QUEUE_TRANSPORT_BOOK_REQ); | ||
} | ||
|
||
@Bean | ||
public Queue getTransportsRequest() { | ||
return new Queue("transports.requests.getTransportsBySearchQuery", false); | ||
} | ||
|
||
@Bean | ||
public Queue getTransportsResponse() { | ||
return new Queue("transports.responses.getTransportsBySearchQuery", false); | ||
} | ||
} |
Oops, something went wrong.