The arrest and detention of two Canadians by China late last year was an event that looked eerily familiar to Japan. It is, for the government in Tokyo, part of a pattern they have had to contend with over the last few years.

China's detention of Canadians Michael Kovrig and Michael Spavor — allegedly in retaliation over Canada's arrest of Huawei executive Meng Wanzhou for extradition to the U.S. on fraud charges — shocked the general public in this country and left federal policymakers reeling.

For Japan, however, such conflicts are just a basic feature of its relationship with an enormous and powerful neighbour — something to be handled with extraordinary delicacy.

Which is why Prime Minister Justin Trudeau can be expected to compare notes with his Japanese counterpart, Shinzo Abe, when the two meet this weekend.

"Canada is not the only country whose nationals are detained in China," Kimihiro Ishikane, Japan's ambassador to Canada, told CBC News. "A certain number of our nationals are also detained in China."

Japanese Ambassador Kimihiro Ishikane speaks to CBC News on April 24, 2019. (Andrew Lee/CBC News)

Since China updated its national security laws in late 2014, nine Japanese citizens have been jailed or detained in China on espionage-related charges.

Some have been held for up to three years, while at least one recently received a 12-year jail sentence for spying last July.

There is a long history of diplomatic tension between Tokyo and Beijing, but it was rekindled in 2012 in a dispute over eight uninhabited islands — little more than hunks of rock — in the East China Sea.

Both countries lay claim to the islands, which are known as the Diaoyu islands in China and as the Senkaku islands in Japan.

They're important economically because of potential mineral reserves and fishing rights in the surrounding seas. Their strategic military value comes from their proximity to nearby shipping lanes.

The takeaway for Canada from this long-running saga, said Ishikane, is that managing and resolving a dispute with China requires patience, stamina and consistent messaging.

"We have to be very, extremely cautious in how we convey the message," he said. "How we convey the message, who conveys it, at what time and how."

Canada hasn't exactly excelled in its message management since the Chinese detained Kovrig and Spavor late last year. Early this year, Trudeau fired his then-ambassador to China, John McCallum, after the ambassador appeared to be stepping offside with the Liberal government in controversial remarks about Wanzhou's extradition case.

Since then, the diplomatic brawl with the Chinese has spread to the canola fields of Western Canada, where a move by China to block shipments of canola seed has producers looking anxiously to planting season.

Prime Minister Justin Trudeau walks with Prime Minister of Japan Shinzo Abe before a family photograph during the G7 leaders summit in La Malbaie, Que., on Friday, June 8, 2018. (Justin Tang/THE CANADIAN PRESS)

Ishikane said Abe and his country's foreign minister have picked their moments to make their points with China.

"Sometimes we need to say it in public, and many times we need to do that in a very discreet manner," he said.

Relations between Japan and China did warm up following Abe's trip to Beijing last fall. Chinese President Xi Jinping is expected to visit Japan for this year's G20 summit in Osaka.

The gathering of world leaders is also something Abe and Trudeau will talk about — but the matter of the detainees feeds into the important, big-picture questions the two prime ministers will have to consider this weekend, said Ishikane.

"How to interact with China? How to have a constructive relation with that huge country is an area where we can really compare notes," he said. "China is an opportunity, but could be a challenge."

Colin Robertson, a former diplomat and vice-president at the Canadian Global Affairs Institute, said China has been playing hardball with Canada and the Liberal government should push back more forcefully, even at the risk of further retaliation.

"The Chinese will continue to ratchet up the pressure. I think they truly believe — they're convinced — that if they put enough pressure on us we will free Meng Wanzhou," he said.

Beijing has "the weight and they'll swing it and they do it in part to demonstrate" that to other nations, he added.

Robertson said the Trudeau government should recognize that it is dealing with an authoritarian regime which takes "hostages" to secure leverage — which should come as no surprise, since China was using it as a part of its statecraft during the Cultural Revolution of the 1960s.

CBC Politics' new weekly Canada Votes Newsletter

Get analysis from our Parliamentary bureau as we count down to the federal election. Delivered to your inbox every Sunday evening – then daily during the campaign. Sign up here