小编Вла*_*хин的帖子

Kafkajs消费和生产批次问题

我想在我的 Node.js 项目中使用 kafkajs。让我展示我的代码。

制作人:

const producer = kafka.producer();
await producer.connect();
const items = await getItems(); // getting somehow 5k items to produce 
await producer.send({
  topic: "items",
  messages: items.map(c => ({ value: JSON.stringify(c) })),
});
// even if I split here on chunks like this, in consumer I get batch with more than 100 items
/*
  const chunked = _.chunk(items, 100);
  for (var chunk of chunked) {
    await producer.send({
      topic: config.kafka.topics.tm.itemsToParse,
      messages: chunk.map(c => ({ value: JSON.stringify(c) })),
      headers: { …
Run Code Online (Sandbox Code Playgroud)

apache-kafka kafkajs

9
推荐指数
0
解决办法
2411
查看次数

如何修复“Underfull \hbox (badness 10000)”警告?

我有这个小的 .tex 文件。

\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{titling}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{tikz}


\setlength{\droptitle}{-3.5cm}
\setlength{\parindent}{0cm}
\newcommand{\squad}{\hspace{0.5em}}

\author{vladgovor77771}
\title{Some article}

\begin{document}
\maketitle

\textbf{Task 1} \newline
Task description: \newline

\end{document}
Run Code Online (Sandbox Code Playgroud)

编译时,它警告行

\textbf{Task 1} \newline
Run Code Online (Sandbox Code Playgroud)

“未满 \hbox(坏处 10000)”。

如何解决?

latex tex pdflatex

5
推荐指数
3
解决办法
1万
查看次数

标签 统计

apache-kafka ×1

kafkajs ×1

latex ×1

pdflatex ×1

tex ×1