# Difference between tell and ask in a shard

**URL:** <https://discuss.akka.io/t/difference-between-tell-and-ask-in-a-shard/6313>\
**Category:** Akka Cluster\
**Created:** [April 21, 2020, 8:48am UTC](https://discuss.akka.io/t/difference-between-tell-and-ask-in-a-shard/6313 "2020-04-21T08:48:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alan.brewster73](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@alan.brewster73](https://discuss.akka.io/u/alan.brewster73)\
**Post date:** [April 21, 2020, 8:48am UTC](https://discuss.akka.io/t/difference-between-tell-and-ask-in-a-shard/6313/1 "2020-04-21T08:48:54Z")

</div>

Hello.

Could someone please explain in the below snippet why the tellShard call always work as expected in a multi-node cluster. But the askShard call only works if an external call hits the node that hosts the shard and times out on all other nodes? Many thanks.

```auto
  val sharding = ClusterSharding(system)

  val messageExtractor =
    new HashCodeNoEnvelopeMessageExtractor[ShoppingCartActor.CartCommand](numberOfShards = 30) {
      override def entityId(message: ShoppingCartActor.CartCommand): String = "Cart"
    }

  val shardRegion: ActorRef[ShoppingCartActor.CartCommand] = sharding.init(
      Entity(ShoppingCartActor.TypeKey) { context =>
        ShoppingCartActor()
      }.withMessageExtractor(messageExtractor)
  )

  def tellShard() = {
    shardRegion ! ShoppingCartActor.Ping
  }

  def askShard(id: String, quantity: Int): Future[CartState] = {
    shardRegion ? (ShoppingCartActor.AddItem(id, quantity, _))
  }

```
