我想在我的 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) 我有这个小的 .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)”。
如何解决?