Prerequisites: level 102, Python 3.10 or later, and the TeleQuick Python SDK. Outcome: distinguish encoding, topic matching, a publish call, and confirmed receipt by another client. Allow: 40 minutes after the SDK and training relay are ready.

What you will build

A publisher sends numbered temperature readings on academy/alice/temperature. A subscriber receives only messages that match its filter. The topic is an application name. It is not an IP subnet or a destination port. The first mode checks the real SDK’s message encoding and topic matching without a connection. The other two modes use the SDK’s native transport to reach a relay. A successful local check does not establish that a relay works.

1. Prepare the SDK

Use the Python installation guide for a compatible SDK and native library. The module used here is telequick.data; the distribution is telequick-sdk. The agents package is a different package and is not the dependency for this lab. For an engineering checkout, you can point Python at the SDK source directory:
Use the directory that contains the telequick package. For a standalone language repository, this can be the repository root instead of a python subdirectory. This route needs no package installation for the local check. Record the SDK commit or installed version in your lab result. The API shape was checked against shared SDK commit 6f21187966f63405b549d26df9a5190fa75ba85e. Its relevant methods are Data.publish, Data.subscribe, Data.close, and DataSubscription.close.
The local encoding and filter exercise can run without credentials or a native library. The relay exercise requires a training endpoint, scoped credentials, and the compatible native lsquic library. Ask the training administrator for those inputs before starting the relay exercise.

2. Save the program

Save the following code as data_lab.py:

3. Check encoding and matching locally

Run python3 data_lab.py check. On Windows, use py -3 for this local check if needed. The expected output is:
This checks the actual SDK’s encoding functions. It does not create a fake relay or substitute a different transport. If Python reports a missing module, check the SDK installation or PYTHONPATH. Do not change the network configuration to fix an import error.

4. Prepare two relay clients

Use a relay that the training administrator authorizes for the exercise. Request separate publish and subscribe credentials if the deployment requires them. Both must refer to the intended tenant and permit the intended operations. In each terminal, set these variables through your normal credential mechanism: Choose a unique topic in a shared lab, such as academy/your-name/temperature. Use the same topic in both terminals. Topic filters do not establish a security boundary; the relay must enforce authorization. The native relay exercise requires a platform supported by the installed native library. Use the SDK’s lsquic transport. Do not substitute a different Python QUIC implementation.

5. Run the subscriber and publisher

In terminal A, run:
In terminal B, run:
The publisher continues to send one reading per second until you stop it. PUBLISH CALLED means the SDK call returned. It is not a delivery acknowledgment. Subscription requested also does not prove that an authorized subscription is active. The success condition is output in terminal A such as:
The initial sequence and any gaps depend on timing and delivery. These lines illustrate the expected format; they are not a captured production result. If no readings arrive within 15 seconds, stop both clients and use the debugging lab.

6. Stop and explain

Press Ctrl+C in both terminals. The program closes the subscription before it closes the client. It creates no retained readings and makes no changes to network configuration. Remove the credential variables from your shell when you finish. Record the SDK version, relay, topic, and three received sequence numbers without recording credentials.
A one-message publisher can finish before a subscriber is ready. Repeated numbered readings make that timing visible without claiming that a fixed sleep establishes readiness. A production workflow might require an explicit acknowledgment or a durable replay mechanism.
Completion check: explain which output proves local encoding, which proves a returned call, and which proves receipt by the subscriber. Next: diagnose three pub/sub failures.