Download the PHP package togomq/togomq-sdk without Composer

On this page you can find all versions of the php package togomq/togomq-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package togomq-sdk

TogoMQ SDK for PHP

CI License: MIT

The official PHP SDK for TogoMQ - a modern, high-performance message queue service. This SDK provides a simple and intuitive API for publishing and subscribing to messages using gRPC streaming.

Features

Requirements

Installation

Install the SDK using Composer:

Make sure you have the gRPC PHP extension installed:

Configuration

The SDK supports flexible configuration with sensible defaults:

Default Configuration

Configuration Options

Option Default Description
Host q.togomq.io TogoMQ server hostname
Port 5123 TogoMQ server port
LogLevel info Logging level (debug, info, warn, error, none)
Token (required) Authentication token

Custom Configuration

Usage

Publishing Messages

Publishing a Batch of Messages

Subscribing to Messages

Basic Subscription

Advanced Subscription with Options

Subscription Options:

Subscribe to All Topics (Wildcard)

Subscribe with Pattern Wildcards

Subscription with Error Handling

Message Structure

Publishing Message

Important: Topic is required when publishing messages.

Received Message

Error Handling

The SDK provides detailed error information:

Error Codes

Logging

Control logging verbosity with the logLevel configuration:

Log levels:

Best Practices

  1. Reuse Clients: Create one client per application and reuse it across requests
  2. Handle Errors: Always check and handle errors appropriately
  3. Close Connections: Always call $client->close() when done
  4. Batch Messages: Use pubBatch() for better performance when publishing multiple messages
  5. Monitor Subscriptions: Use try-catch blocks to handle subscription errors gracefully
  6. Validate Topics: Always provide valid topic names for both publishing and subscribing

Examples

Check out the examples/ directory for complete working examples:

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Related Projects


All versions of togomq-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
togomq/togomq-grpc Version dev-main
grpc/grpc Version ^1.57
psr/log Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package togomq/togomq-sdk contains the following files

Loading the files please wait ...