Documentation
¶
Overview ¶
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or apiied. See the License for the specific language governing permissions and limitations under the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func RemoveMQClient(clientId string)
- type Callback
- type Config
- type MQClient
- func (mqClient *MQClient) ConsumeMessageDirectly(msg *message.MessageExt, consumerGroup, brokerName string) *head.ConsumeMessageDirectlyResult
- func (mqClient *MQClient) FindBrokerAddressInPublish(brokerName string) string
- func (mqClient *MQClient) RegisterConsumer(group string, consumer consumerInner) bool
- func (mqClient *MQClient) RegisterProducer(group string, producer producerInner) bool
- func (mqClient *MQClient) SendHeartbeatToAllBrokerWithLock() error
- func (mqClient *MQClient) SendMessage(addr string, brokerName string, msg *message.Message, ...) (*Result, error)
- func (mqClient *MQClient) SetDefaultProduer(producer producerOuter)
- func (mqClient *MQClient) Shutdown()
- func (mqClient *MQClient) Start()
- func (mqClient *MQClient) UnRegisterConsumer(group string)
- func (mqClient *MQClient) UnRegisterProducer(group string)
- func (mqClient *MQClient) UpdateTopicRouteInfoFromNameServer()
- func (mqClient *MQClient) UpdateTopicRouteInfoFromNameServerByArgs(topic string, isDefault bool, producer producerOuter) bool
- func (mqClient *MQClient) UpdateTopicRouteInfoFromNameServerByTopic(topic string) bool
- type ProcessQueue
- type PullCallback
- type PullRequest
- type PullResultExt
- type Result
- type TopicPublishInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
NameSrvAddrs []string
InstanceName string
ClientIP string
ClientCallbackExecutorThreads int
PullNameServerInteval int
HeartbeatBrokerInterval int
PersistConsumerOffsetInterval int
}
func (*Config) ChangeInstanceNameToPID ¶
func (cfg *Config) ChangeInstanceNameToPID()
type MQClient ¶
type MQClient struct {
// contains filtered or unexported fields
}
func GetAndCreateMQClient ¶
GetAndCreateMQClient 查询MQClient,无则创建一个
func NewMQClient ¶
NewMQClient 初始化
func (*MQClient) ConsumeMessageDirectly ¶
func (mqClient *MQClient) ConsumeMessageDirectly(msg *message.MessageExt, consumerGroup, brokerName string) *head.ConsumeMessageDirectlyResult
func (*MQClient) FindBrokerAddressInPublish ¶
查找broker的master地址
func (*MQClient) RegisterConsumer ¶
RegisterConsumer 将生产者group和发送类保存到内存中
func (*MQClient) RegisterProducer ¶
RegisterProducer 将生产者group和发送类保存到内存中
func (*MQClient) SendHeartbeatToAllBrokerWithLock ¶
向所有boker发送心跳
func (*MQClient) SendMessage ¶
func (*MQClient) SetDefaultProduer ¶
func (mqClient *MQClient) SetDefaultProduer(producer producerOuter)
func (*MQClient) UnRegisterConsumer ¶
UnRegisterConsumer 注销消费者
func (*MQClient) UnRegisterProducer ¶
UnRegisterProducer 注销生产者
func (*MQClient) UpdateTopicRouteInfoFromNameServer ¶
func (mqClient *MQClient) UpdateTopicRouteInfoFromNameServer()
从nameserver更新路由信息
func (*MQClient) UpdateTopicRouteInfoFromNameServerByArgs ¶
func (*MQClient) UpdateTopicRouteInfoFromNameServerByTopic ¶
type ProcessQueue ¶
type ProcessQueue struct {
Dropped bool
LastPullTimestamp int64
PullMaxIdleTime int64
MsgCount int64
QueueOffsetMax int64
Consuming bool
MsgAccCnt int64
// contains filtered or unexported fields
}
func NewProcessQueue ¶
func NewProcessQueue() *ProcessQueue
func (*ProcessQueue) GetMaxSpan ¶
func (pq *ProcessQueue) GetMaxSpan() int64
func (*ProcessQueue) IsPullExpired ¶
func (pq *ProcessQueue) IsPullExpired() bool
func (*ProcessQueue) PutMessage ¶
func (pq *ProcessQueue) PutMessage(msgs []*message.MessageExt) bool
func (*ProcessQueue) RemoveMessage ¶
func (pq *ProcessQueue) RemoveMessage(msgs []*message.MessageExt) int64
func (*ProcessQueue) String ¶
func (pq *ProcessQueue) String() string
type PullCallback ¶
type PullCallback interface {
OnSuccess(pullResultExt *PullResultExt)
}
type PullRequest ¶
type PullResultExt ¶
type PullResultExt struct {
*common.PullResult
// contains filtered or unexported fields
}
type TopicPublishInfo ¶
type TopicPublishInfo struct {
Order bool
HaveTopicRouterInfo bool
MessageQueues []*message.MessageQueue
SendWhichQueue int64
}
func (*TopicPublishInfo) SelectOneMessageQueue ¶
func (info *TopicPublishInfo) SelectOneMessageQueue(lastBrokerName string) *message.MessageQueue
取模获取选择队列
func (*TopicPublishInfo) String ¶
func (info *TopicPublishInfo) String() string