Clarify why `/confirm` reconstructs TCC participant URIs from `TransactionHistory` when the `Link` header is already provided

Abierto
#177 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
58/100
Tipo de issue
Documentación
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
java, spring-boot

Línea de trabajo

Comienza con las implementaciones de /reserve y /confirm/{tripBookingId} del servicio travel-agent, especialmente con getTravelParticipants(...) y el manejo del encabezado Link. Rastrea cómo TransactionHistory almacena las URI de las reservas de hotel y vuelo, y luego añade una breve nota de ejemplo que distinga la URI de la transacción de las URI de los participantes y explique por qué el flujo en dos pasos las reconstruye.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Hi Oracle MicroTx team,

I was going through the TCC Spring Boot sample and had a question about the two-step reservation flow, specifically the /confirm/{tripBookingId} endpoint in the travel-agent service.

From what I understand, the /reserve endpoint creates the reservations and returns a Link header containing the MicroTx TCC transaction URI. Later, the client passes that Link header back when calling /confirm/{tripBookingId}.

However, in the /confirm implementation, the code also fetches the saved TransactionHistory by tripBookingId and reconstructs the participant list from the stored reservation URIs:

BookingHistory.TransactionHistory transactionHistory = service.get(tripBookingId);
List<TccParticipant> participants = getTravelParticipants(transactionHistory);

ConfirmResponse confirmResponse = tccClientService.confirm(participants);

And getTravelParticipants(...) manually builds the participant list using the hotel and flight booking URIs stored in TransactionHistory.

My question is:

If the client is already passing the MicroTx Link header back to /confirm, why does the initiator still need to reconstruct the participant URIs from TransactionHistory?

I originally expected the Link header to be enough for MicroTx to identify the existing TCC transaction and its already-registered participants, especially since the participant services call addTccParticipant(...) during the Try/reservation phase.

So I am trying to understand whether the intended model is:

  1. The Link header only identifies or resumes the TCC transaction, but does not by itself provide the participant reservation URIs to the initiator.
  2. The initiator must persist the reservation URIs itself if confirm/cancel happens in a later HTTP request.
  3. confirm(participants) is used in the two-step flow because the original Try-phase call stack and collected participant headers are no longer available.
  4. addTccParticipant(...) is still needed during the Try phase for protocol-level enlistment, but the two-step sample also stores URIs in application state so they can be supplied again later.

Is that the correct interpretation?

If so, it might be helpful to add a short comment or note in the sample explaining the difference between:

  • the MicroTx transaction URI in the Link header, and
  • the participant reservation URIs stored in TransactionHistory.

Right now, it is a little hard to tell whether the stored participant URI reconstruction is required by the TCC protocol, required only by this sample’s two-step design, or just an implementation choice.

Thanks a lot for the sample. It has been helpful given lack of api documentation.

Lenguaje dominante
JavaScript
Estrellas
9
Forks
6
Merge medio
11 h 12 min
PR fusionados (30 d)
2

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.