Despite Ireland's liberal friends always trying to deny it, immigration is one of the most divisive issues in western countries today.

In the U.S. there's Trump and the wall, in Europe there's a deep split between EU countries and miles of razor wire. Germany's Angela Merkel is losing her power over it and Britain's Theresa May is on the brink this week as Parliament votes on her Brexit plan.

Brexit has become so complicated, mainly due to the Irish border question, that at this stage it's easy to forget that the main issue that led to the referendum in the U.K. in 2016 and the vote to leave the EU was dissatisfaction with immigration.

Here in Ireland, we have escaped most of the turmoil caused by migration so far. We have managed to do so because of our location as an island on the furthest edge of the continent, far removed from the problems faced by other countries in mainland Europe. This has allowed us to adopt a liberal, at times almost boastful attitude, insisting that Ireland will always be the country of the Cead Mile Failte (hundred thousand welcomes) and we will always look after asylum seekers.

That sounds good, but the uncomfortable truth is that we have not really been tested on the issue. The number of migrants who have arrived here over the past decade or so in comparison with other European countries is very small.

Those who have got in are put into Direct Provision (DP), the system in which they are housed and fed but get little else while they await a decision on their asylum applications, a wait which often runs into years. And during that time many remain largely isolated from the local community.

Because of the shortage and expense of accommodation in Dublin most of the DP centers are spread around the country, often using struggling hotels in small towns for which it is a way of making a guaranteed income from the state.

A count a few months ago showed there were around 6,000 asylum seekers in around 35 DP centers (mostly hotels) around the country with one reception center in Dublin. The system is run by a state body called the Reception and Integration Agency (RIA).

Typically, the RIA negotiates with the hotel or property owner in secret, and there is no consultation with the local community before a deal is completed and a new center is announced. Despite claims to the contrary, the reason it is done this way is to avoid local opposition.

Up to now, the RIA has managed to get away with this approach, but it is beginning to run into problems. Three new centers were proposed in the last year, in Moville in Co. Donegal, Rooskey in Co. Roscommon and Wicklow town.

Last week, the hotel which was to be used to house 80 migrants in Rooskey was hit by an arson attack. You may remember that the same thing happened a few months back when the hotel in Moville which was to house around 100 migrants was badly damaged in another arson attack. And there is considerable local opposition to the planned DP center in Wicklow where 100 asylum seekers are to be housed in the town's only hotel.

Typically, up to now, despite anger over the absence of advance consultation, the RIA has relied on the goodwill of local people to make the best of the situation once it is foisted on them. Local people in some DP towns have set up committees to help the new arrivals with language classes, activities for children and so on.

Opposition has remained muted, largely because people are afraid of accusations of racism and being vilified in the liberal national media. But there is no doubt that there is considerable silent opposition.

Despite this, there is a determination at official level to carry on and to deny any negativity. The reaction to last week's arson attack in Rooskey was typical, with a government minister and most local leaders condemning it and insisting that it was not representative of the community. A small demonstration in support of migrants was held in Rooskey a few days after the fire, although many of those involved were not from the town.

But the opposition is becoming more vocal. One local politician last week was outspoken about it. "We cannot continue to operate the present system of Direct Provision and dealing with asylum seekers by railroading them into small rural villages around the country where there is no infrastructure in place to meet their needs," he said.

And that is the problem. With almost no money to spend and nothing to do, most migrants don't want to be in remote small towns like Moville and Rooskey.

Their presence is far from ideal either for the migrants themselves or the locals. Little or no extra resources are made available to the already strained local services like health care or schools. It's left to the local people to try to make it work.

Moville, where 100 migrants were to be housed, has a population of around 1,400. It's a small seaside town on the Inishowen peninsula in Donegal -- a beautiful but very remote location -- which has struggled in recent years to develop its tourism. Losing one of the few hotels in the area to the DP system does not help.

It's the same in Rooskey on the Roscommon/Leitrim border, a village of around 500 people which was due to host 80 migrants. Again it's a remote location with hopes of developing tourism (because it's on the Shannon) and that won't be helped by its hotel being used to house migrants.

For reasons like this, the issue has caused tension and division in small towns like Moville and Rooskey, with people torn between wanting to be charitable and to help those in need and worried about the effects on their local communities.

In the wider context there is also uncertainty about the whole migration question and the way Europe is dealing with it. There are growing concerns in many European countries, even liberal countries like Germany and Sweden, about the difficulties that have emerged when migrants (the majority of them young men) from very different cultures arrive.

And there is the realization that most of those who manage to make their way into Europe are economic migrants with enough resources to travel, pay smugglers etc, and are not those most in need. Last weekend, for example, while the Rooskey arson incident was making headlines here, many of the one million Syrian refugees stuck in the vast migrant camps in Lebanon were coping with flooded tents when the area was hit by heavy rain and very cold weather.

One might well ask whether the money being spent here on DP hotel accommodation for migrants who have jumped the system would be better spent on improving the miserable conditions for the several million in the camps in Lebanon, Turkey and elsewhere in the region.

Also last week, Ireland agreed to be one of a number of EU countries which will take a share of the 50 migrants who have been stuck on two rescue ships near Malta for nearly three weeks after rescue in the Mediterranean. With Italy refusing to allow the ships to dock and other EU countries disagreeing on what to do, the situation had attracted widespread criticism.

It has now been resolved, but doubts persist in Europe about whether rescue ships in the Med, both naval vessels and those operated by migrant charities, are attracting even more migrants to attempt a crossing in dangerous small craft run by smugglers which then have to be rescued.

Last year over 113,000 migrants crossed the Med in this way, paying up to $1,000 each for a seat on a boat and making this a lucrative business. Looking after them in Europe then costs uncounted tens of millions while those most in need, the families stuck in the refugee camps in Turkey and Northern Africa, struggle to survive in appalling conditions.

Also coinciding with the Rooskey headlines last week was the visit by Taoiseach Leo Varadkar to Ethiopia, part of his six day trip to Africa. Not surprisingly he was asked by the Irish reporters with him about the arson attack. His reply was carefully nuanced.

Generally speaking Irish people have been quite welcoming of refugees, he said. But it was important that concerns about migration must not be dismissed. Doing so was a "political mistake" that had been made across Europe.

"Migration is a good thing," he said, "but it does need to be managed. We need to manage it right and see the picture as a whole, not just about responding to refugee crises or humanitarian crises, but about the best in international development, peace, security. Those are the policies that work in the long term."

He said the most effective way to address the migrant crisis in Europe was by continuing economic and development aid to poor countries in Africa. Europe cannot afford to take a 30 percent chunk of Africa's population, he warned.

"The best thing we can do is bring our experience in the European Union to Africa. Africa is an enormous continent and potentially wealthy. If we can get Africa right, we won't need to see millions of people leaving their homes and trying to cross the Mediterranean,” he said.

He also recognized the real fears of some Irish people on migration.

"They have concerns about the increasing impact migration has on housing, for example, the impact on the health and education systems, particularly when there are a lot of kids in school who do not have English as a first language. They have concerns about security and crime,” he said.

Varadkar did not say that such fears are justified. But his general view does seem to be in line with developing opinion in Europe on the issue. It's much more complicated than simply taking in anyone who arrives, as some migrant supporting groups here say we must.

As the taoiseach said, the ultimate answer lies in improving the countries migrants are coming from, whether that's in Africa or South America.