github gofr-dev/gofr v1.53.0

one day ago

Release v1.53.0

🚀 Features

🔹 Amazon SQS PubSub Support

GoFr now supports Amazon SQS as a messaging backend, enabling seamless integration with AWS Simple Queue Service for building resilient, distributed microservices.

  • Supports both Publishing and Subscribing to SQS standard queues
  • Configurable Behavior:
    • Support for custom message attributes
    • Configurable visibility timeouts and wait times
    • Support for standard queues

Usage Example

To use Amazon SQS, import the driver and add it to your application:

import (
    "gofr.dev/pkg/gofr"
    "gofr.dev/pkg/gofr/datasource/pubsub/sqs"
)

func main() {
    app := gofr.New()

    app.AddPubSub(sqs.New(&sqs.Config{
        Region:          "us-east-1",
        AccessKeyID:     "your-access-key-id",     // optional if using IAM roles
        SecretAccessKey: "your-secret-access-key", // optional if using IAM roles
        // Endpoint:     "http://localhost:4566", // optional: for LocalStack
    }))

    app.Subscribe("my-queue", func(ctx *gofr.Context) error {
        // Process message
        return nil
    })

    app.Run()
}

🚀 Enhancements

🔹 Metrics for HTTP Service Resilience

Enhanced observability for inter-service communication by adding dedicated metrics for resilience patterns.

🔹 Configurable Metrics Server

Added the ability to disable the internal metrics server by setting the METRICS_PORT environment variable to 0. This provides greater flexibility for users who prefer to handle metrics collection through external agents or in environments where a separate metrics port is not required.

🛠️ Fixes

🔹 Zip Slip Vulnerability Protection

Improved the security of the file/zip package by implementing protection against Zip Slip (path traversal) attacks.

  • Automatically validates file paths during extraction to ensure they remain within the target directory
  • Rejects zip entries containing absolute paths or parent directory traversal sequences (..)
  • Ensures safe handling of compressed files from untrusted sources

Don't miss a new gofr release

NewReleases is sending notifications on new releases.