DocumentationDocumentationNewsNewsSupportSupportDashboardDashboard (opens in a new tab)GitHubGitHub (opens in a new tab) (opens in a new tab)
  • What is Bref and serverless?
  • Getting started
  • Setup
    • Getting started
    • File Storage
    • Laravel Queues
    • Laravel Octane
    • Laravel Passport
    • Caching
    • Maintenance Mode
    • Getting started
    • Symfony Messenger
    • Caching
    • Keeping the Kernel alive
    • Getting Started
    • CLI commands
  • How it works
  • PHP runtimes for Lambda
    • PHP-FPM runtime
    • Function runtime
    • Console runtime
    • Runtimes in details
  • Serverless costs
  • Workflow
  • Deployment
    • Deploying Docker images
    • Deploying with AWS CDK
  • Local development
    • Event-driven functions
  • Monitoring
  • Learn more
    • HTTP applications
      • Custom domains
      • Binary requests and responses
      • Advanced HTTP use cases
    • Websites
    • Static websites
    • Cron tasks
    • S3 file processing
    • SQS asynchronous tasks
    • EventBridge event bus
    • WebSockets
    • SNS events
    • DynamoDB events
    • Kinesis stream processing
    • Kafka events
    • Custom architecture
    • serverless.yml
    • Environment variables
    • PHP
    • Storage
    • Logs
    • Databases
    • Databases - PlanetScale
    • Performance
    • From 1.x to 2.0
  • Resources
  • Serverless course
  • Community
  • Case Studies
    • Treezor
Question? Give us feedback → (opens in a new tab)Edit this page
Documentation
Use cases
Kafka events

Kafka events

To handle Kafka events (opens in a new tab), extend the KafkaHandler class:

use Bref\Context\Context;
use Bref\Event\Kafka\KafkaEvent;
use Bref\Event\Kafka\KafkaEventHandler;
 
class Handler extends KafkaEvent
{
    public function handleKafka(KafkaEvent $event, Context $context): void
    {
        foreach ($event->getRecords() as $record) {
            $data = $record->getValue();
 
            // do something
        }
    }
}
Kinesis stream processingCustom architecture
Home
Documentation
News
Support
Bref Dashboard
Credits
GitHubGitHubTwitterSlack

© 2023 Matthieu Napoli