Complete the code to show a request-response call between two microservices.
response = serviceB.[1](request_data)In request-response, one service calls another's API directly, so call_api fits.
Complete the code to publish an event in an event-driven microservice.
event_bus.[1](event_data)Event-driven systems use publish_event to send messages asynchronously.
Fix the error in the event-driven consumer code to properly handle incoming events.
def on_event_received(event): [1](event.data) # Missing function to process event data
The consumer should call a function like process_event to handle the event data.
Fill both blanks to complete the request-response flow: client sends request and waits for response.
response = client.[1](request) if response.[2] == 200: handle_success(response.data)
Client sends a request with send_request and checks status_code for success.
Fill all three blanks to complete the event-driven consumer that subscribes, processes, and acknowledges events.
event_bus.[1]('order_created', on_order) def on_order(event): [2](event.data) event.[3]()
The consumer subscribes to events, process_order handles data, and acknowledge confirms event processing.