What you will build
A publisher sends numbered temperature readings onacademy/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 istelequick.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:
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 asdata_lab.py:
3. Check encoding and matching locally
Runpython3 data_lab.py check.
On Windows, use py -3 for this local check if needed.
The expected output is:
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: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:
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.Why does the program keep publishing?
Why does the program keep publishing?
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.