|
|
|
@ -30,13 +30,19 @@ func (b *MessageQueueBroker) SubscribeWithOffset( |
|
|
|
return fmt.Errorf("missing init message") |
|
|
|
} |
|
|
|
|
|
|
|
// TODO: Fix partition access - SubscribeMessageRequest_InitMessage may not have Partition field
|
|
|
|
// ASSUMPTION: Using a default partition for now
|
|
|
|
// Extract partition information from the request
|
|
|
|
t := topic.FromPbTopic(initMessage.Topic) |
|
|
|
|
|
|
|
// Get partition from the request's partition_offset field
|
|
|
|
if initMessage.PartitionOffset == nil || initMessage.PartitionOffset.Partition == nil { |
|
|
|
return fmt.Errorf("missing partition information in request") |
|
|
|
} |
|
|
|
|
|
|
|
// Use the partition information from the request
|
|
|
|
p := topic.Partition{ |
|
|
|
RingSize: 1024, |
|
|
|
RangeStart: 0, |
|
|
|
RangeStop: 31, |
|
|
|
RingSize: initMessage.PartitionOffset.Partition.RingSize, |
|
|
|
RangeStart: initMessage.PartitionOffset.Partition.RangeStart, |
|
|
|
RangeStop: initMessage.PartitionOffset.Partition.RangeStop, |
|
|
|
UnixTimeNs: time.Now().UnixNano(), |
|
|
|
} |
|
|
|
|
|
|
|
@ -151,13 +157,13 @@ func (b *MessageQueueBroker) GetSubscriptionInfo(subscriptionID string) (map[str |
|
|
|
} |
|
|
|
|
|
|
|
return map[string]interface{}{ |
|
|
|
"subscription_id": subscription.ID, |
|
|
|
"start_offset": subscription.StartOffset, |
|
|
|
"current_offset": subscription.CurrentOffset, |
|
|
|
"offset_type": subscription.OffsetType.String(), |
|
|
|
"is_active": subscription.IsActive, |
|
|
|
"lag": lag, |
|
|
|
"at_end": atEnd, |
|
|
|
"subscription_id": subscription.ID, |
|
|
|
"start_offset": subscription.StartOffset, |
|
|
|
"current_offset": subscription.CurrentOffset, |
|
|
|
"offset_type": subscription.OffsetType.String(), |
|
|
|
"is_active": subscription.IsActive, |
|
|
|
"lag": lag, |
|
|
|
"at_end": atEnd, |
|
|
|
}, nil |
|
|
|
} |
|
|
|
|
|
|
|
|