Skip to content

Conversation

@benjamin99
Copy link
Collaborator

Summary

  • Fixed nil pointer dereference by initializing pulsar client before subscription creation
  • The PulsarConsumerSource.Capture method was attempting to call p.client.Subscribe() without initializing p.client first
  • Added pulsar.NewClient() call to match the initialization pattern used in PulsarReaderSource.Capture

Changes

  • pkg/source/pulsar.go:195-198: Initialize pulsar client before creating consumer subscription

Impact

This resolves a critical bug where the pulsar consumer would crash with a nil pointer error when attempting to create subscriptions. The fix ensures proper client initialization following the same pattern as the reader source implementation.

Test plan

  • Verify pulsar consumer can successfully create subscriptions without nil pointer errors
  • Confirm consumer operations work as expected after client initialization
  • Test that the fix doesn't introduce any regressions in existing functionality

🤖 Generated with Claude Code

The previous implementation attempted to create a subscription without
initializing the pulsar client first, resulting in a nil pointer error
when calling p.client.Subscribe(). This fix ensures the client is properly
initialized before any subscription operations.

Changes:
- Add pulsar.NewClient() call before Subscribe() in PulsarConsumerSource.Capture
- Mirror the initialization pattern used in PulsarReaderSource.Capture

Fixes nil pointer dereference when creating pulsar consumer subscriptions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@benjamin99 benjamin99 merged commit 0dc7134 into master Nov 18, 2025
0 of 7 checks passed
@benjamin99 benjamin99 deleted the fix/fix-nil-pulsar-client-issue branch November 18, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants